diff mbox series

usb: typec: mux: Remove some unneeded includes

Message ID 1db1e8bd253cbb652835c0cef6a0a2bb9a4970eb.1682325582.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Accepted
Commit 986866c3dfb0f930c5cc109a6c509c1391d96b5f
Headers show
Series usb: typec: mux: Remove some unneeded includes | expand

Commit Message

Christophe JAILLET April 24, 2023, 8:39 a.m. UTC
This driver includes many header files that are unneeded.
Remove them and add <linux/device.h> where devm_kzalloc() is defined.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Based on one of my script, this reduces the number of included files
during the build process of this file from 551 to 345.
---
 drivers/usb/typec/mux/gpio-sbu-mux.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Heikki Krogerus April 24, 2023, 1:04 p.m. UTC | #1
On Mon, Apr 24, 2023 at 10:39:56AM +0200, Christophe JAILLET wrote:
> This driver includes many header files that are unneeded.
> Remove them and add <linux/device.h> where devm_kzalloc() is defined.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
> Based on one of my script, this reduces the number of included files
> during the build process of this file from 551 to 345.
> ---
>  drivers/usb/typec/mux/gpio-sbu-mux.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> index f62516dafe8f..c07856069d43 100644
> --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> @@ -3,14 +3,11 @@
>   * Copyright (C) 2022 Linaro Ltd.
>   */
>  
> -#include <linux/bits.h>
> -#include <linux/i2c.h>
> -#include <linux/kernel.h>
> +#include <linux/device.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/platform_device.h>
> -#include <linux/regmap.h>
>  #include <linux/usb/typec_dp.h>
>  #include <linux/usb/typec_mux.h>
>  
> -- 
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
index f62516dafe8f..c07856069d43 100644
--- a/drivers/usb/typec/mux/gpio-sbu-mux.c
+++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
@@ -3,14 +3,11 @@ 
  * Copyright (C) 2022 Linaro Ltd.
  */
 
-#include <linux/bits.h>
-#include <linux/i2c.h>
-#include <linux/kernel.h>
+#include <linux/device.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/gpio/consumer.h>
 #include <linux/platform_device.h>
-#include <linux/regmap.h>
 #include <linux/usb/typec_dp.h>
 #include <linux/usb/typec_mux.h>