All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Evgeniy Polyakov <zbr@ioremap.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ville Syrjala <syrjala@sci.fi>, Daniel Mack <zonque@gmail.com>
Subject: [PATCH 3/5] W1: w1-gpio - guard DT IDs with CONFIG_OF
Date: Fri, 22 Feb 2013 23:58:38 -0800	[thread overview]
Message-ID: <1361606320-4479-3-git-send-email-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <1361606320-4479-1-git-send-email-dmitry.torokhov@gmail.com>

This fixes the following warning:

  CC      drivers/w1/masters/w1-gpio.o
drivers/w1/masters/w1-gpio.c:50:28: warning: ‘w1_gpio_dt_ids’ defined but not used [-Wunused-variable]

Also provide stub for w1_gpio_probe_dt() if device tree support is
disabled.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/w1/masters/w1-gpio.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index c45b9ae..aa97a96 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -47,6 +47,8 @@ static u8 w1_gpio_read_bit(void *data)
 	return gpio_get_value(pdata->pin) ? 1 : 0;
 }
 
+#ifdef CONFIG_OF
+
 static struct of_device_id w1_gpio_dt_ids[] = {
 	{ .compatible = "w1-gpio" },
 	{}
@@ -72,6 +74,15 @@ static int w1_gpio_probe_dt(struct platform_device *pdev)
 	return 0;
 }
 
+#else
+
+static inline int w1_gpio_probe_dt(struct platform_device *pdev)
+{
+	return -ENOSYS;
+}
+
+#endif
+
 static int w1_gpio_probe(struct platform_device *pdev)
 {
 	struct w1_bus_master *master;
-- 
1.7.11.7


  parent reply	other threads:[~2013-02-23  7:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23  7:58 [PATCH 1/5] W1: w1-gpio - fix incorrect __init/__exit markups Dmitry Torokhov
2013-02-23  7:58 ` [PATCH 2/5] W1: w1-gpio - switch to using dev_pm_ops Dmitry Torokhov
2013-02-23  7:58 ` Dmitry Torokhov [this message]
2013-02-23  7:58 ` [PATCH 4/5] W1: w1-gpio - rework handling of platform data Dmitry Torokhov
2013-02-23 16:55   ` Ville Syrjälä
2013-02-23 20:06     ` Dmitry Torokhov
2013-02-23  7:58 ` [PATCH 5/5] W1: w1-gpio - switch to using managed resources (devm) Dmitry Torokhov
2013-02-25  6:59 ` [PATCH v2 1/5] W1: w1-gpio - fix incorrect __init/__exit markups Dmitry Torokhov
2013-02-25  6:59   ` [PATCH 2/5] W1: w1-gpio - switch to using dev_pm_ops Dmitry Torokhov
2013-02-25  6:59   ` [PATCH 3/5] W1: w1-gpio - guard DT IDs with CONFIG_OF Dmitry Torokhov
2013-03-12 23:23     ` Greg Kroah-Hartman
2013-02-25  6:59   ` [PATCH 4/5] W1: w1-gpio - rework handling of platform data Dmitry Torokhov
2013-02-25  6:59   ` [PATCH 5/5] W1: w1-gpio - switch to using managed resources (devm) Dmitry Torokhov
2013-03-12 23:23   ` [PATCH v2 1/5] W1: w1-gpio - fix incorrect __init/__exit markups Greg Kroah-Hartman

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=1361606320-4479-3-git-send-email-dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syrjala@sci.fi \
    --cc=zbr@ioremap.net \
    --cc=zonque@gmail.com \
    /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 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.