public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-gpio@vger.kernel.org, gnurou@gmail.com,
	linus.walleij@linaro.org, Wei.Chen@csr.com, Baohua.Song@csr.com,
	Murilo Opsfelder Araujo <mopsfelder@gmail.com>
Subject: [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined
Date: Thu, 22 Jan 2015 22:37:09 -0200	[thread overview]
Message-ID: <1421973429-9663-1-git-send-email-mopsfelder@gmail.com> (raw)

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


             reply	other threads:[~2015-01-23  0:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  0:37 Murilo Opsfelder Araujo [this message]
2015-01-23  0:45 ` [PATCH] gpio: sx150x: Fix compile issue when CONFIG_OF_GPIO is not defined Alexandre Courbot
2015-01-23  0:58   ` Murilo Opsfelder Araújo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421973429-9663-1-git-send-email-mopsfelder@gmail.com \
    --to=mopsfelder@gmail.com \
    --cc=Baohua.Song@csr.com \
    --cc=Wei.Chen@csr.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox