2014-06-04 16:44:18

by Jim Davis

[permalink] [raw]
Subject: randconfig build error with next-20140604, in drivers/i2c/muxes/i2c-mux-pca954x.c

Building with the attached random configuration file,

drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
gpio = devm_gpiod_get(&client->dev, "reset");
^
drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
pointer from integer without a cast [enabled by default]
gpio = devm_gpiod_get(&client->dev, "reset");
^
drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
of function ‘gpiod_direction_output’
[-Werror=implicit-function-declaration]
gpiod_direction_output(gpio, 0);
^
cc1: some warnings being treated as errors
make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1


Attachments:
randconfig-1401881013.txt (110.33 kB)

2014-06-04 16:56:12

by Laurent Pinchart

[permalink] [raw]
Subject: [PATCH] i2c: pca954x: Fix compilation without CONFIG_GPIOLIB

The pca954x driver recently switched to the GPIO descriptor API without
including the correct <linux/gpio/consumer.h> header. This breaks
compilation without CONFIG_GPIOLIB.

drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
gpio = devm_gpiod_get(&client->dev, "reset");
^
drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
pointer from integer without a cast [enabled by default]
gpio = devm_gpiod_get(&client->dev, "reset");
^
drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
of function ‘gpiod_direction_output’
[-Werror=implicit-function-declaration]
gpiod_direction_output(gpio, 0);
^
cc1: some warnings being treated as errors
make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1

Fix it by including the right header.

Reported-by: Jim Davis <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
---
drivers/i2c/muxes/i2c-mux-pca954x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index c2c443f..9bd4212 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -36,12 +36,11 @@
*/

#include <linux/device.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include <linux/i2c/pca954x.h>
#include <linux/module.h>
-#include <linux/of_gpio.h>
#include <linux/slab.h>

#define PCA954X_MAX_NCHANS 8
--
Regards,

Laurent Pinchart

2014-06-04 21:02:18

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH] i2c: pca954x: Fix compilation without CONFIG_GPIOLIB

On Wed, 4 Jun 2014 18:56:32 +0200, Laurent Pinchart wrote:
> The pca954x driver recently switched to the GPIO descriptor API without
> including the correct <linux/gpio/consumer.h> header. This breaks
> compilation without CONFIG_GPIOLIB.
>
> drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
> of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
> pointer from integer without a cast [enabled by default]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
> of function ‘gpiod_direction_output’
> [-Werror=implicit-function-declaration]
> gpiod_direction_output(gpio, 0);
> ^
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1
>
> Fix it by including the right header.
>
> Reported-by: Jim Davis <[email protected]>
> Signed-off-by: Laurent Pinchart <[email protected]>
> ---
> drivers/i2c/muxes/i2c-mux-pca954x.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> (...)

Acked-by: Jean Delvare <[email protected]>

--
Jean Delvare
SUSE L3 Support

2014-06-05 01:57:59

by Jingoo Han

[permalink] [raw]
Subject: Re: [PATCH] i2c: pca954x: Fix compilation without CONFIG_GPIOLIB

On Thursday, June 05, 2014 1:57 AM, Laurent Pinchart write/l
>
> The pca954x driver recently switched to the GPIO descriptor API without
> including the correct <linux/gpio/consumer.h> header. This breaks
> compilation without CONFIG_GPIOLIB.
>
> drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
> of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
> pointer from integer without a cast [enabled by default]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
> of function ‘gpiod_direction_output’
> [-Werror=implicit-function-declaration]
> gpiod_direction_output(gpio, 0);
> ^
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1
>
> Fix it by including the right header.
>
> Reported-by: Jim Davis <[email protected]>
> Signed-off-by: Laurent Pinchart <[email protected]>

Reviewed-by: Jingoo Han <[email protected]>

Best regards,
Jingoo Han

> ---
> drivers/i2c/muxes/i2c-mux-pca954x.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
> index c2c443f..9bd4212 100644
> --- a/drivers/i2c/muxes/i2c-mux-pca954x.c
> +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
> @@ -36,12 +36,11 @@
> */
>
> #include <linux/device.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/i2c.h>
> #include <linux/i2c-mux.h>
> #include <linux/i2c/pca954x.h>
> #include <linux/module.h>
> -#include <linux/of_gpio.h>
> #include <linux/slab.h>
>
> #define PCA954X_MAX_NCHANS 8
> --
> Regards,
>
> Laurent Pinchart

2014-06-05 13:11:36

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: pca954x: Fix compilation without CONFIG_GPIOLIB

On Wed, Jun 04, 2014 at 06:56:32PM +0200, Laurent Pinchart wrote:
> The pca954x driver recently switched to the GPIO descriptor API without
> including the correct <linux/gpio/consumer.h> header. This breaks
> compilation without CONFIG_GPIOLIB.
>
> drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
> of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
> pointer from integer without a cast [enabled by default]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
> of function ‘gpiod_direction_output’
> [-Werror=implicit-function-declaration]
> gpiod_direction_output(gpio, 0);
> ^
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1
>
> Fix it by including the right header.
>
> Reported-by: Jim Davis <[email protected]>
> Signed-off-by: Laurent Pinchart <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (1.19 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-06-09 13:12:04

by Linus Walleij

[permalink] [raw]
Subject: Re: randconfig build error with next-20140604, in drivers/i2c/muxes/i2c-mux-pca954x.c

On Wed, Jun 4, 2014 at 6:44 PM, Jim Davis <[email protected]> wrote:

> Building with the attached random configuration file,
>
> drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
> of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
> pointer from integer without a cast [enabled by default]
> gpio = devm_gpiod_get(&client->dev, "reset");
> ^
> drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
> of function ‘gpiod_direction_output’
> [-Werror=implicit-function-declaration]
> gpiod_direction_output(gpio, 0);
> ^
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1

I've sent a patch for this to Wolfram and the i2c discuss list.

Yours,
Linus Walleij

2014-06-09 13:31:12

by Laurent Pinchart

[permalink] [raw]
Subject: Re: randconfig build error with next-20140604, in drivers/i2c/muxes/i2c-mux-pca954x.c

On Monday 09 June 2014 15:12:01 Linus Walleij wrote:
> On Wed, Jun 4, 2014 at 6:44 PM, Jim Davis <[email protected]> wrote:
> > Building with the attached random configuration file,
> >
> > drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
> > drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
> > of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
> >
> > gpio = devm_gpiod_get(&client->dev, "reset");
> > ^
> >
> > drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
> > pointer from integer without a cast [enabled by default]
> >
> > gpio = devm_gpiod_get(&client->dev, "reset");
> >
> > ^
> >
> > drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
> > of function ‘gpiod_direction_output’
> > [-Werror=implicit-function-declaration]
> >
> > gpiod_direction_output(gpio, 0);
> > ^
> >
> > cc1: some warnings being treated as errors
> > make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1
>
> I've sent a patch for this to Wolfram and the i2c discuss list.

https://git.kernel.org/cgit/linux/kernel/git/wsa/linux.git/commit/?h=i2c/for-next&id=642653d16a0f8e78b7a25d930b62aa771ebc939c

--
Regards,

Laurent Pinchart