lkml.org 
[lkml]   [2022]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] gpio: Do not include <linux/kernel.h> when not really needed.
Date
<linux/kernel.h> is included only for using container_of().
Include <linux/container_of.h> instead, it is much lighter.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure if the prefix should be gpio or gpiolib.

Let see if build-bots spot something which is inherit via kernel.h
---
include/linux/of_gpio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index a5166eb93437..6db627257a7b 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -34,7 +34,7 @@ enum of_gpio_flags {

#ifdef CONFIG_OF_GPIO

-#include <linux/kernel.h>
+#include <linux/container_of.h>

/*
* OF GPIO chip for memory mapped banks
--
2.34.1
\
 
 \ /
  Last update: 2022-11-27 22:52    [W:0.044 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site