From: Daniel Mack <zonque@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: lgirdwood@gmail.com, broonie@kernel.org, Daniel Mack <zonque@gmail.com>
Subject: [PATCH 2/3] regulators: max8660: add a shorthand to &client->dev
Date: Fri, 2 Aug 2013 10:19:16 +0200 [thread overview]
Message-ID: <1375431557-3096-2-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1375431557-3096-1-git-send-email-zonque@gmail.com>
No functional change, just makes the code shorter.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
drivers/regulator/max8660.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index ba3b8af..a5caaa0 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -314,6 +314,7 @@ static int max8660_probe(struct i2c_client *client,
const struct i2c_device_id *i2c_id)
{
struct regulator_dev **rdev;
+ struct device *dev = &client->dev;
struct max8660_platform_data *pdata = client->dev.platform_data;
struct regulator_config config = { };
struct max8660 *max8660;
@@ -321,11 +322,11 @@ static int max8660_probe(struct i2c_client *client,
unsigned int type;
if (pdata->num_subdevs > MAX8660_V_END) {
- dev_err(&client->dev, "Too many regulators found!\n");
+ dev_err(dev, "Too many regulators found!\n");
return -EINVAL;
}
- max8660 = devm_kzalloc(&client->dev, sizeof(struct max8660) +
+ max8660 = devm_kzalloc(dev, sizeof(struct max8660) +
sizeof(struct regulator_dev *) * MAX8660_V_END,
GFP_KERNEL);
if (!max8660)
@@ -384,7 +385,7 @@ static int max8660_probe(struct i2c_client *client,
case MAX8660_V7:
if (type == MAX8661) {
- dev_err(&client->dev, "Regulator not on this chip!\n");
+ dev_err(dev, "Regulator not on this chip!\n");
goto err_out;
}
@@ -393,7 +394,7 @@ static int max8660_probe(struct i2c_client *client,
break;
default:
- dev_err(&client->dev, "invalid regulator %s\n",
+ dev_err(dev, "invalid regulator %s\n",
pdata->subdevs[i].name);
goto err_out;
}
@@ -404,14 +405,14 @@ static int max8660_probe(struct i2c_client *client,
id = pdata->subdevs[i].id;
- config.dev = &client->dev;
+ config.dev = dev;
config.init_data = pdata->subdevs[i].platform_data;
config.driver_data = max8660;
rdev[i] = regulator_register(&max8660_reg[id], &config);
if (IS_ERR(rdev[i])) {
ret = PTR_ERR(rdev[i]);
- dev_err(&client->dev, "failed to register %s\n",
+ dev_err(dev, "failed to register %s\n",
max8660_reg[id].name);
goto err_unregister;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-08-02 8:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 8:19 [PATCH 1/3] regulators: max8660: use i2c_id->driver_data rather than ->name Daniel Mack
2013-08-02 8:19 ` Daniel Mack [this message]
2013-08-02 10:16 ` [PATCH 2/3] regulators: max8660: add a shorthand to &client->dev Mark Brown
2013-08-02 8:19 ` [PATCH 3/3] regulators: max8660: add DT bindings Daniel Mack
2013-08-02 10:18 ` Mark Brown
2013-08-02 10:16 ` [PATCH 1/3] regulators: max8660: use i2c_id->driver_data rather than ->name 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=1375431557-3096-2-git-send-email-zonque@gmail.com \
--to=zonque@gmail.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--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