diff options
author | Daniel Mack <zonque@gmail.com> | 2013-08-02 04:19:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-02 06:23:55 -0400 |
commit | de492e8de8d05f29cc496871d42763d0a8a74610 (patch) | |
tree | 4bfc98947337cee3723564e78e7f328d931ff582 /drivers/regulator | |
parent | 4a678f037475edd362a18fc3c4616d6222be3042 (diff) |
regulators: max8660: add a shorthand to &client->dev
No functional change, just makes the code shorter.
[Resolved conflict with platdata patch -- broonie]
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/max8660.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index 5a734fc9618c..74c11aa00c8a 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c | |||
@@ -314,18 +314,19 @@ static int max8660_probe(struct i2c_client *client, | |||
314 | const struct i2c_device_id *i2c_id) | 314 | const struct i2c_device_id *i2c_id) |
315 | { | 315 | { |
316 | struct regulator_dev **rdev; | 316 | struct regulator_dev **rdev; |
317 | struct max8660_platform_data *pdata = dev_get_platdata(&client->dev); | 317 | struct device *dev = &client->dev; |
318 | struct max8660_platform_data *pdata = dev_get_platdata(dev); | ||
318 | struct regulator_config config = { }; | 319 | struct regulator_config config = { }; |
319 | struct max8660 *max8660; | 320 | struct max8660 *max8660; |
320 | int boot_on, i, id, ret = -EINVAL; | 321 | int boot_on, i, id, ret = -EINVAL; |
321 | unsigned int type; | 322 | unsigned int type; |
322 | 323 | ||
323 | if (pdata->num_subdevs > MAX8660_V_END) { | 324 | if (pdata->num_subdevs > MAX8660_V_END) { |
324 | dev_err(&client->dev, "Too many regulators found!\n"); | 325 | dev_err(dev, "Too many regulators found!\n"); |
325 | return -EINVAL; | 326 | return -EINVAL; |
326 | } | 327 | } |
327 | 328 | ||
328 | max8660 = devm_kzalloc(&client->dev, sizeof(struct max8660) + | 329 | max8660 = devm_kzalloc(dev, sizeof(struct max8660) + |
329 | sizeof(struct regulator_dev *) * MAX8660_V_END, | 330 | sizeof(struct regulator_dev *) * MAX8660_V_END, |
330 | GFP_KERNEL); | 331 | GFP_KERNEL); |
331 | if (!max8660) | 332 | if (!max8660) |
@@ -384,7 +385,7 @@ static int max8660_probe(struct i2c_client *client, | |||
384 | 385 | ||
385 | case MAX8660_V7: | 386 | case MAX8660_V7: |
386 | if (type == MAX8661) { | 387 | if (type == MAX8661) { |
387 | dev_err(&client->dev, "Regulator not on this chip!\n"); | 388 | dev_err(dev, "Regulator not on this chip!\n"); |
388 | goto err_out; | 389 | goto err_out; |
389 | } | 390 | } |
390 | 391 | ||
@@ -393,7 +394,7 @@ static int max8660_probe(struct i2c_client *client, | |||
393 | break; | 394 | break; |
394 | 395 | ||
395 | default: | 396 | default: |
396 | dev_err(&client->dev, "invalid regulator %s\n", | 397 | dev_err(dev, "invalid regulator %s\n", |
397 | pdata->subdevs[i].name); | 398 | pdata->subdevs[i].name); |
398 | goto err_out; | 399 | goto err_out; |
399 | } | 400 | } |
@@ -404,14 +405,14 @@ static int max8660_probe(struct i2c_client *client, | |||
404 | 405 | ||
405 | id = pdata->subdevs[i].id; | 406 | id = pdata->subdevs[i].id; |
406 | 407 | ||
407 | config.dev = &client->dev; | 408 | config.dev = dev; |
408 | config.init_data = pdata->subdevs[i].platform_data; | 409 | config.init_data = pdata->subdevs[i].platform_data; |
409 | config.driver_data = max8660; | 410 | config.driver_data = max8660; |
410 | 411 | ||
411 | rdev[i] = regulator_register(&max8660_reg[id], &config); | 412 | rdev[i] = regulator_register(&max8660_reg[id], &config); |
412 | if (IS_ERR(rdev[i])) { | 413 | if (IS_ERR(rdev[i])) { |
413 | ret = PTR_ERR(rdev[i]); | 414 | ret = PTR_ERR(rdev[i]); |
414 | dev_err(&client->dev, "failed to register %s\n", | 415 | dev_err(dev, "failed to register %s\n", |
415 | max8660_reg[id].name); | 416 | max8660_reg[id].name); |
416 | goto err_unregister; | 417 | goto err_unregister; |
417 | } | 418 | } |