[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87io25psit.fsf@ti.com>
Date: Wed, 03 Feb 2016 20:18:02 +0200
From: Felipe Balbi <balbi@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>, Felipe Balbi <balbi@...com>
Cc: Alexandre Courbot <gnurou@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
linux-usb@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 1/3] usb: phy: generic: use forward declarations instead of #includes
Bjorn Helgaas <bhelgaas@...gle.com> writes:
> In include/linux/usb/usb_phy_generic.h, use a forward declaration for
> struct gpio_desc instead of including linux/gpio/consumer.h.
>
> Of the files that include usb_phy_generic.h, only
> drivers/usb/phy/phy-generic.c uses the gpiod_*() interfaces from
> linux/gpio/consumer.h, so include consumer.h explicitly there.
>
> This is a little more efficient and ensures that users of the gpiod
> interfaces include linux/gpio/consumer.h directly rather than getting it
> accidentally via linux/usb/usb_phy_generic.h.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
> ---
> drivers/usb/phy/phy-generic.c | 1 +
> include/linux/usb/usb_phy_generic.h | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> index 5320cb8..2c1349e 100644
> --- a/drivers/usb/phy/phy-generic.c
> +++ b/drivers/usb/phy/phy-generic.c
> @@ -36,6 +36,7 @@
> #include <linux/of.h>
> #include <linux/of_gpio.h>
> #include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/delay.h>
>
> #include "phy-generic.h"
> diff --git a/include/linux/usb/usb_phy_generic.h b/include/linux/usb/usb_phy_generic.h
> index c13632d5..45c20060 100644
> --- a/include/linux/usb/usb_phy_generic.h
> +++ b/include/linux/usb/usb_phy_generic.h
> @@ -2,7 +2,8 @@
> #define __LINUX_USB_NOP_XCEIV_H
>
> #include <linux/usb/otg.h>
> -#include <linux/gpio/consumer.h>
> +
> +struct gpio_desc;
then someone decides to rename struct gpio_desc and this just becomes
yet another place to fix. Why is this any better than just including the
header ?
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)
Powered by blists - more mailing lists