All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined
@ 2015-01-23  0:37 ` Murilo Opsfelder Araujo
  0 siblings, 0 replies; 4+ messages in thread
From: Murilo Opsfelder Araujo @ 2015-01-23  0:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-gpio, gnurou, linus.walleij, Wei.Chen, Baohua.Song,
	Murilo Opsfelder Araujo

Without this patch, the compilation of gpio-sx150x.c fails because
struct gpio_chip members 'of_node' and 'of_gpio_n_cells' do not exist
when CONFIG_OF_GPIO is not defined:

drivers/gpio/gpio-sx150x.c: In function ‘sx150x_init_chip’:
drivers/gpio/gpio-sx150x.c:487:17: error: ‘struct gpio_chip’ has no member named ‘of_node’
  chip->gpio_chip.of_node          = client->dev.of_node;
                 ^
drivers/gpio/gpio-sx150x.c:488:17: error: ‘struct gpio_chip’ has no member named ‘of_gpio_n_cells’
  chip->gpio_chip.of_gpio_n_cells  = 2;
                 ^

This issue was introduced by the commit
04d2264c3bf07f5c3d18165ba78de0a93360c6c0 "gpio: sx150x: add dts support for sx150x driver".

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
 drivers/gpio/gpio-sx150x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index 88012e2..b1e2f1c 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -484,8 +484,10 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
 	chip->gpio_chip.base             = pdata->gpio_base;
 	chip->gpio_chip.can_sleep        = true;
 	chip->gpio_chip.ngpio            = chip->dev_cfg->ngpios;
+#ifdef CONFIG_OF_GPIO
 	chip->gpio_chip.of_node          = client->dev.of_node;
 	chip->gpio_chip.of_gpio_n_cells  = 2;
+#endif
 	if (pdata->oscio_is_gpo)
 		++chip->gpio_chip.ngpio;
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined
@ 2015-01-23  0:37 ` Murilo Opsfelder Araujo
  0 siblings, 0 replies; 4+ messages in thread
From: Murilo Opsfelder Araujo @ 2015-01-23  0:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-gpio, gnurou, linus.walleij, Wei.Chen, Baohua.Song,
	Murilo Opsfelder Araujo

Without this patch, the compilation of gpio-sx150x.c fails because
struct gpio_chip members 'of_node' and 'of_gpio_n_cells' do not exist
when CONFIG_OF_GPIO is not defined:

drivers/gpio/gpio-sx150x.c: In function ‘sx150x_init_chip’:
drivers/gpio/gpio-sx150x.c:487:17: error: ‘struct gpio_chip’ has no member named ‘of_node’
  chip->gpio_chip.of_node          = client->dev.of_node;
                 ^
drivers/gpio/gpio-sx150x.c:488:17: error: ‘struct gpio_chip’ has no member named ‘of_gpio_n_cells’
  chip->gpio_chip.of_gpio_n_cells  = 2;
                 ^

This issue was introduced by the commit
04d2264c3bf07f5c3d18165ba78de0a93360c6c0 "gpio: sx150x: add dts support for sx150x driver".

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
 drivers/gpio/gpio-sx150x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index 88012e2..b1e2f1c 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -484,8 +484,10 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
 	chip->gpio_chip.base             = pdata->gpio_base;
 	chip->gpio_chip.can_sleep        = true;
 	chip->gpio_chip.ngpio            = chip->dev_cfg->ngpios;
+#ifdef CONFIG_OF_GPIO
 	chip->gpio_chip.of_node          = client->dev.of_node;
 	chip->gpio_chip.of_gpio_n_cells  = 2;
+#endif
 	if (pdata->oscio_is_gpo)
 		++chip->gpio_chip.ngpio;
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined
  2015-01-23  0:37 ` Murilo Opsfelder Araujo
  (?)
@ 2015-01-23  0:45 ` Alexandre Courbot
  2015-01-23  0:58   ` Murilo Opsfelder Araújo
  -1 siblings, 1 reply; 4+ messages in thread
From: Alexandre Courbot @ 2015-01-23  0:45 UTC (permalink / raw)
  To: Murilo Opsfelder Araujo
  Cc: Linux Kernel Mailing List, linux-gpio, Linus Walleij, Wei.Chen,
	Baohua.Song

On Fri, Jan 23, 2015 at 9:37 AM, Murilo Opsfelder Araujo
<mopsfelder@gmail.com> wrote:
> Without this patch, the compilation of gpio-sx150x.c fails because
> struct gpio_chip members 'of_node' and 'of_gpio_n_cells' do not exist
> when CONFIG_OF_GPIO is not defined:
>
> drivers/gpio/gpio-sx150x.c: In function ‘sx150x_init_chip’:
> drivers/gpio/gpio-sx150x.c:487:17: error: ‘struct gpio_chip’ has no member named ‘of_node’
>   chip->gpio_chip.of_node          = client->dev.of_node;
>                  ^
> drivers/gpio/gpio-sx150x.c:488:17: error: ‘struct gpio_chip’ has no member named ‘of_gpio_n_cells’
>   chip->gpio_chip.of_gpio_n_cells  = 2;
>                  ^
>
> This issue was introduced by the commit
> 04d2264c3bf07f5c3d18165ba78de0a93360c6c0 "gpio: sx150x: add dts support for sx150x driver".
>
> Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
> ---
>  drivers/gpio/gpio-sx150x.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
> index 88012e2..b1e2f1c 100644
> --- a/drivers/gpio/gpio-sx150x.c
> +++ b/drivers/gpio/gpio-sx150x.c
> @@ -484,8 +484,10 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
>         chip->gpio_chip.base             = pdata->gpio_base;
>         chip->gpio_chip.can_sleep        = true;
>         chip->gpio_chip.ngpio            = chip->dev_cfg->ngpios;
> +#ifdef CONFIG_OF_GPIO
>         chip->gpio_chip.of_node          = client->dev.of_node;
>         chip->gpio_chip.of_gpio_n_cells  = 2;
> +#endif
>         if (pdata->oscio_is_gpo)
>                 ++chip->gpio_chip.ngpio;

Linus just sent a patch to fix this, see
http://patchwork.ozlabs.org/patch/431704/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined
  2015-01-23  0:45 ` Alexandre Courbot
@ 2015-01-23  0:58   ` Murilo Opsfelder Araújo
  0 siblings, 0 replies; 4+ messages in thread
From: Murilo Opsfelder Araújo @ 2015-01-23  0:58 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Linux Kernel Mailing List, linux-gpio, Linus Walleij, wei.chen,
	baohua.song

On Thu, Jan 22, 2015 at 10:45 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
[...]
> Linus just sent a patch to fix this, see
> http://patchwork.ozlabs.org/patch/431704/

Nice to know it has already been addressed.  Thanks for the link, Alexandre.

-- 
Murilo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-23  0:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23  0:37 [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined Murilo Opsfelder Araujo
2015-01-23  0:37 ` Murilo Opsfelder Araujo
2015-01-23  0:45 ` Alexandre Courbot
2015-01-23  0:58   ` Murilo Opsfelder Araújo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.