Skip to contentSkip to conversation

gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined

PATCH In review Murilo Opsfelder Araujo 2 participants 3 messages Jan 23, 2015 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined

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".

---
 drivers/gpio/gpio-sx150x.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpio/gpio-sx150x.c +2 -0
index 88012e2..b1e2f1c 100644
@@ -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;
 
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 25 lines · 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".

---
 drivers/gpio/gpio-sx150x.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpio/gpio-sx150x.c +0 -0
index 88012e2..b1e2f1c 100644

drivers/gpio/gpio-sx150x.c static void sx150x_init_chip(struct sx150x_chip *chip, · line 492

Quoted 9 lines
drivers/gpio/gpio-sx150x.c +2 -0
@@ -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/