From: Nicolae Rosia <Nicolae_Rosia@mentor.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, <linux-omap@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Nicolae Rosia <Nicolae_Rosia@mentor.com>
Subject: [PATCH 1/4] regulator: twl: make driver DT only
Date: Sat, 12 Nov 2016 14:42:12 +0200 [thread overview]
Message-ID: <1478954535-17325-2-git-send-email-Nicolae_Rosia@mentor.com> (raw)
In-Reply-To: <1478954535-17325-1-git-send-email-Nicolae_Rosia@mentor.com>
All users are DT only, remove unused code.
Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
drivers/regulator/twl-regulator.c | 37 ++++++-------------------------------
1 file changed, 6 insertions(+), 31 deletions(-)
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 210681d..f92b13a 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1165,37 +1165,20 @@ static int twlreg_probe(struct platform_device *pdev)
struct regulator_init_data *initdata;
struct regulation_constraints *c;
struct regulator_dev *rdev;
- struct twl_regulator_driver_data *drvdata;
const struct of_device_id *match;
struct regulator_config config = { };
match = of_match_device(twl_of_match, &pdev->dev);
- if (match) {
- template = match->data;
- id = template->desc.id;
- initdata = of_get_regulator_init_data(&pdev->dev,
- pdev->dev.of_node,
- &template->desc);
- drvdata = NULL;
- } else {
- id = pdev->id;
- initdata = dev_get_platdata(&pdev->dev);
- for (i = 0, template = NULL; i < ARRAY_SIZE(twl_of_match); i++) {
- template = twl_of_match[i].data;
- if (template && template->desc.id == id)
- break;
- }
- if (i == ARRAY_SIZE(twl_of_match))
- return -ENODEV;
-
- drvdata = initdata->driver_data;
- if (!drvdata)
- return -EINVAL;
- }
+ if (!match)
+ return -ENODEV;
+ template = match->data;
if (!template)
return -ENODEV;
+ id = template->desc.id;
+ initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node,
+ &template->desc);
if (!initdata)
return -EINVAL;
@@ -1203,14 +1186,6 @@ static int twlreg_probe(struct platform_device *pdev)
if (!info)
return -ENOMEM;
- if (drvdata) {
- /* copy the driver data into regulator data */
- info->features = drvdata->features;
- info->data = drvdata->data;
- info->set_voltage = drvdata->set_voltage;
- info->get_voltage = drvdata->get_voltage;
- }
-
/* Constrain board-specific capabilities according to what
* this driver and the chip itself can actually do.
*/
--
2.5.5
next prev parent reply other threads:[~2016-11-12 12:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-12 12:42 [PATCH 0/4] regulator: twl: preparation for TWL6032 support Nicolae Rosia
2016-11-12 12:42 ` Nicolae Rosia [this message]
2016-11-18 12:02 ` Applied "regulator: twl: make driver DT only" to the regulator tree Mark Brown
2016-11-12 12:42 ` [PATCH 2/4] regulator: twl: kill unused functions Nicolae Rosia
2016-11-18 12:02 ` Applied "regulator: twl: kill unused functions" to the regulator tree Mark Brown
2016-11-12 12:42 ` [PATCH 3/4] regulator: twl-regulator: rework fixed regulator definition Nicolae Rosia
2016-11-18 12:02 ` Applied "regulator: twl-regulator: rework fixed regulator definition" to the regulator tree Mark Brown
2016-11-12 12:42 ` [PATCH 4/4] regulator: twl: split twl6030 logic into its own file Nicolae Rosia
2016-11-18 12:01 ` Applied "regulator: twl: split twl6030 logic into its own file" to the regulator tree Mark Brown
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=1478954535-17325-2-git-send-email-Nicolae_Rosia@mentor.com \
--to=nicolae_rosia@mentor.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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 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®