Re: [PATCH] PCI: amlogic: fix build failure due to missing linux/gpio/consumer.h header

From: LABBE Corentin
Date: Fri Jan 04 2019 - 05:36:33 EST


On Fri, Jan 04, 2019 at 10:30:25AM +0000, Lorenzo Pieralisi wrote:
> On Fri, Jan 04, 2019 at 09:08:37AM +0000, Corentin Labbe wrote:
> > When building on x86, I got the following build failure:
>
> Hi,
>
> what tree are you testing on and which config ?

I use the next-20190102 tree
The config can be found at http://kernel.montjoie.ovh/configs/x86

Regards

>
> Thanks,
> Lorenzo
>
> > drivers/pci/controller/dwc/pci-meson.c: In function âmeson_pcie_assert_resetâ:
> > drivers/pci/controller/dwc/pci-meson.c:290:2: error: implicit declaration of function âgpiod_set_value_cansleepâ; did you mean âgpio_set_value_cansleepâ? [-Werror=implicit-function-declaration]
> > gpiod_set_value_cansleep(mp->reset_gpio, 0);
> > ^~~~~~~~~~~~~~~~~~~~~~~~
> > gpio_set_value_cansleep
> > drivers/pci/controller/dwc/pci-meson.c: In function âmeson_pcie_probeâ:
> > drivers/pci/controller/dwc/pci-meson.c:540:19: error: implicit declaration of function âdevm_gpiod_getâ; did you mean âdevm_gpio_freeâ? [-Werror=implicit-function-declaration]
> > mp->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> > ^~~~~~~~~~~~~~
> > devm_gpio_free
> > drivers/pci/controller/dwc/pci-meson.c:540:48: error: âGPIOD_OUT_LOWâ undeclared (first use in this function); did you mean âGPIOF_INIT_LOWâ?
> > mp->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> > ^~~~~~~~~~~~~
> > GPIOF_INIT_LOW
> >
> > This is due to the missing linux/gpio/consumer.h header
> >
> > Signed-off-by: Corentin Labbe <clabbe@xxxxxxxxxxxx>
> > ---
> > drivers/pci/controller/dwc/pci-meson.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> > index 241ebe0c4505..e35e9eaa50ee 100644
> > --- a/drivers/pci/controller/dwc/pci-meson.c
> > +++ b/drivers/pci/controller/dwc/pci-meson.c
> > @@ -8,6 +8,7 @@
> >
> > #include <linux/clk.h>
> > #include <linux/delay.h>
> > +#include <linux/gpio/consumer.h>
> > #include <linux/of_device.h>
> > #include <linux/of_gpio.h>
> > #include <linux/pci.h>
> > --
> > 2.19.2
> >