diff options
| -rw-r--r-- | drivers/regulator/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/regulator/pfuze100-regulator.c | 20 |
2 files changed, 4 insertions, 18 deletions
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index ce785f481281..b4a445e7f78d 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig | |||
| @@ -384,7 +384,7 @@ config REGULATOR_PCF50633 | |||
| 384 | on PCF50633 | 384 | on PCF50633 |
| 385 | 385 | ||
| 386 | config REGULATOR_PFUZE100 | 386 | config REGULATOR_PFUZE100 |
| 387 | tristate "Support regulators on Freescale PFUZE100 PMIC" | 387 | tristate "Freescale PFUZE100 regulator driver" |
| 388 | depends on I2C | 388 | depends on I2C |
| 389 | select REGMAP_I2C | 389 | select REGMAP_I2C |
| 390 | help | 390 | help |
diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index 8b5e4c712a01..0c511ae52c42 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c | |||
| @@ -408,31 +408,18 @@ static int pfuze100_regulator_probe(struct i2c_client *client, | |||
| 408 | config.driver_data = pfuze_chip; | 408 | config.driver_data = pfuze_chip; |
| 409 | config.of_node = match_of_node(i); | 409 | config.of_node = match_of_node(i); |
| 410 | 410 | ||
| 411 | pfuze_chip->regulators[i] = regulator_register(desc, &config); | 411 | pfuze_chip->regulators[i] = |
| 412 | devm_regulator_register(&client->dev, desc, &config); | ||
| 412 | if (IS_ERR(pfuze_chip->regulators[i])) { | 413 | if (IS_ERR(pfuze_chip->regulators[i])) { |
| 413 | dev_err(&client->dev, "register regulator%s failed\n", | 414 | dev_err(&client->dev, "register regulator%s failed\n", |
| 414 | pfuze100_regulators[i].desc.name); | 415 | pfuze100_regulators[i].desc.name); |
| 415 | ret = PTR_ERR(pfuze_chip->regulators[i]); | 416 | return PTR_ERR(pfuze_chip->regulators[i]); |
| 416 | while (--i >= 0) | ||
| 417 | regulator_unregister(pfuze_chip->regulators[i]); | ||
| 418 | return ret; | ||
| 419 | } | 417 | } |
| 420 | } | 418 | } |
| 421 | 419 | ||
| 422 | return 0; | 420 | return 0; |
| 423 | } | 421 | } |
| 424 | 422 | ||
| 425 | static int pfuze100_regulator_remove(struct i2c_client *client) | ||
| 426 | { | ||
| 427 | int i; | ||
| 428 | struct pfuze_chip *pfuze_chip = i2c_get_clientdata(client); | ||
| 429 | |||
| 430 | for (i = 0; i < PFUZE100_MAX_REGULATOR; i++) | ||
| 431 | regulator_unregister(pfuze_chip->regulators[i]); | ||
| 432 | |||
| 433 | return 0; | ||
| 434 | } | ||
| 435 | |||
| 436 | static struct i2c_driver pfuze_driver = { | 423 | static struct i2c_driver pfuze_driver = { |
| 437 | .id_table = pfuze_device_id, | 424 | .id_table = pfuze_device_id, |
| 438 | .driver = { | 425 | .driver = { |
| @@ -441,7 +428,6 @@ static struct i2c_driver pfuze_driver = { | |||
| 441 | .of_match_table = pfuze_dt_ids, | 428 | .of_match_table = pfuze_dt_ids, |
| 442 | }, | 429 | }, |
| 443 | .probe = pfuze100_regulator_probe, | 430 | .probe = pfuze100_regulator_probe, |
| 444 | .remove = pfuze100_regulator_remove, | ||
| 445 | }; | 431 | }; |
| 446 | module_i2c_driver(pfuze_driver); | 432 | module_i2c_driver(pfuze_driver); |
| 447 | 433 | ||
