From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] power: bq24190: Remove gratuitous dummy function
Date: Thu, 13 Mar 2014 09:07:10 +0100 [thread overview]
Message-ID: <1394698031-1313-1-git-send-email-thierry.reding@gmail.com> (raw)
From: Thierry Reding <treding@nvidia.com>
Check for OF support using IS_ENABLED(CONFIG_OF). This will enable the
compiler to eliminate dead code if OF support is disabled. With that in
place, the dummy implementation of bq24190_setup_dt() for non-DT setups
can be removed as the compiler will automatically discard the function
when appropriate.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/power/bq24190_charger.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/power/bq24190_charger.c b/drivers/power/bq24190_charger.c
index ad3ff8fbfbbb..f5b21c0d0ba3 100644
--- a/drivers/power/bq24190_charger.c
+++ b/drivers/power/bq24190_charger.c
@@ -1312,7 +1312,6 @@ out:
return ret;
}
-#ifdef CONFIG_OF
static int bq24190_setup_dt(struct bq24190_dev_info *bdi)
{
bdi->irq = irq_of_parse_and_map(bdi->dev->of_node, 0);
@@ -1321,12 +1320,6 @@ static int bq24190_setup_dt(struct bq24190_dev_info *bdi)
return 0;
}
-#else
-static int bq24190_setup_dt(struct bq24190_dev_info *bdi)
-{
- return -1;
-}
-#endif
static int bq24190_setup_pdata(struct bq24190_dev_info *bdi,
struct bq24190_platform_data *pdata)
@@ -1388,7 +1381,7 @@ static int bq24190_probe(struct i2c_client *client,
i2c_set_clientdata(client, bdi);
- if (dev->of_node)
+ if (IS_ENABLED(CONFIG_OF) && dev->of_node)
ret = bq24190_setup_dt(bdi);
else
ret = bq24190_setup_pdata(bdi, pdata);
--
1.8.4.2
next reply other threads:[~2014-03-13 8:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 8:07 Thierry Reding [this message]
2014-03-13 8:07 ` [PATCH 2/2] power: bq24190: Remove empty OF device table Thierry Reding
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=1394698031-1313-1-git-send-email-thierry.reding@gmail.com \
--to=thierry.reding@gmail.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.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
all inboxes | Powered by JetHome®