From: Mark Brown <broonie@kernel.org>
To: Liam Girdwood <lgirdwood@gmail.com>
Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org,
Mark Brown <broonie@kernel.org>
Subject: [PATCH] regulator: tps65217: Remove spurious platform data check
Date: Sat, 6 Sep 2014 12:11:21 +0100 [thread overview]
Message-ID: <1410001881-14417-1-git-send-email-broonie@kernel.org> (raw)
We should always be able to probe a regulator with no platform data. This
will enable readback of current state, though no changes can be made to
the device configuration.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/tps65217-regulator.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index d58db72a63b0..1cf16aed9735 100644
--- a/drivers/regulator/tps65217-regulator.c
+++ b/drivers/regulator/tps65217-regulator.c
@@ -230,11 +230,6 @@ static int tps65217_regulator_probe(struct platform_device *pdev)
if (tps->dev->of_node)
pdata = tps65217_parse_dt(pdev);
- if (!pdata) {
- dev_err(&pdev->dev, "Platform data not found\n");
- return -EINVAL;
- }
-
if (tps65217_chip_id(tps) != TPS65217) {
dev_err(&pdev->dev, "Invalid tps chip version\n");
return -ENODEV;
@@ -245,7 +240,8 @@ static int tps65217_regulator_probe(struct platform_device *pdev)
for (i = 0; i < TPS65217_NUM_REGULATOR; i++) {
/* Register the regulators */
config.dev = tps->dev;
- config.init_data = pdata->tps65217_init_data[i];
+ if (pdata)
+ config.init_data = pdata->tps65217_init_data[i];
config.driver_data = tps;
config.regmap = tps->regmap;
if (tps->dev->of_node)
--
2.1.0
reply other threads:[~2014-09-06 11:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1410001881-14417-1-git-send-email-broonie@kernel.org \
--to=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linaro-kernel@lists.linaro.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®