diff mbox series

hwmon: (lm75) Replace kernel.h with the necessary inclusions

Message ID 4e07ed43274ad912d4efcfc04f673f25e8f89fdc.1654289489.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Accepted
Headers show
Series hwmon: (lm75) Replace kernel.h with the necessary inclusions | expand

Commit Message

Christophe JAILLET June 3, 2022, 8:51 p.m. UTC
When kernel.h is used in the headers it adds a lot into dependency hell,
especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/hwmon/lm75.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Guenter Roeck June 5, 2022, 5:41 p.m. UTC | #1
On Fri, Jun 03, 2022 at 10:51:46PM +0200, Christophe JAILLET wrote:
> When kernel.h is used in the headers it adds a lot into dependency hell,
> especially when there are circular dependencies are involved.
> 
> Replace kernel.h inclusion with the list of what is really being used.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/lm75.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/lm75.h b/drivers/hwmon/lm75.h
> index a398171162a8..b803ada5e3c9 100644
> --- a/drivers/hwmon/lm75.h
> +++ b/drivers/hwmon/lm75.h
> @@ -11,7 +11,8 @@
>   * which contains this code, we don't worry about the wasted space.
>   */
>  
> -#include <linux/kernel.h>
> +#include <linux/minmax.h>
> +#include <linux/types.h>
>  
>  /* straight from the datasheet */
>  #define LM75_TEMP_MIN (-55000)
diff mbox series

Patch

diff --git a/drivers/hwmon/lm75.h b/drivers/hwmon/lm75.h
index a398171162a8..b803ada5e3c9 100644
--- a/drivers/hwmon/lm75.h
+++ b/drivers/hwmon/lm75.h
@@ -11,7 +11,8 @@ 
  * which contains this code, we don't worry about the wasted space.
  */
 
-#include <linux/kernel.h>
+#include <linux/minmax.h>
+#include <linux/types.h>
 
 /* straight from the datasheet */
 #define LM75_TEMP_MIN (-55000)