diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/ad5398.c | 6 | ||||
-rw-r--r-- | drivers/regulator/bd71815-regulator.c | 10 | ||||
-rw-r--r-- | drivers/regulator/bd71828-regulator.c | 21 | ||||
-rw-r--r-- | drivers/regulator/bd718x7-regulator.c | 53 | ||||
-rw-r--r-- | drivers/regulator/bd9576-regulator.c | 54 | ||||
-rw-r--r-- | drivers/regulator/lp872x.c | 5 | ||||
-rw-r--r-- | drivers/regulator/ltc3589.c | 6 | ||||
-rw-r--r-- | drivers/regulator/max8660.c | 6 | ||||
-rw-r--r-- | drivers/regulator/max8973-regulator.c | 6 | ||||
-rw-r--r-- | drivers/regulator/tps62360-regulator.c | 6 | ||||
-rw-r--r-- | drivers/regulator/tps65023-regulator.c | 6 |
11 files changed, 78 insertions, 101 deletions
diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c index 75f432f61e91..2ba8ac1773d1 100644 --- a/drivers/regulator/ad5398.c +++ b/drivers/regulator/ad5398.c @@ -212,9 +212,9 @@ static const struct i2c_device_id ad5398_id[] = { }; MODULE_DEVICE_TABLE(i2c, ad5398_id); -static int ad5398_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ad5398_probe(struct i2c_client *client) { + const struct i2c_device_id *id = i2c_client_get_device_id(client); struct regulator_init_data *init_data = dev_get_platdata(&client->dev); struct regulator_config config = { }; struct ad5398_chip_info *chip; @@ -254,7 +254,7 @@ static int ad5398_probe(struct i2c_client *client, } static struct i2c_driver ad5398_driver = { - .probe = ad5398_probe, + .probe_new = ad5398_probe, .driver = { .name = "ad5398", }, diff --git a/drivers/regulator/bd71815-regulator.c b/drivers/regulator/bd71815-regulator.c index c2b8b8be7824..8b55046eded8 100644 --- a/drivers/regulator/bd71815-regulator.c +++ b/drivers/regulator/bd71815-regulator.c @@ -602,12 +602,10 @@ static int bd7181x_probe(struct platform_device *pdev) config.ena_gpiod = NULL; rdev = devm_regulator_register(&pdev->dev, desc, &config); - if (IS_ERR(rdev)) { - dev_err(&pdev->dev, - "failed to register %s regulator\n", - desc->name); - return PTR_ERR(rdev); - } + if (IS_ERR(rdev)) + return dev_err_probe(&pdev->dev, PTR_ERR(rdev), + "failed to register %s regulator\n", + desc->name); } return 0; } diff --git a/drivers/regulator/bd71828-regulator.c b/drivers/regulator/bd71828-regulator.c index a4f09a5a30ca..ad728f4f2241 100644 --- a/drivers/regulator/bd71828-regulator.c +++ b/drivers/regulator/bd71828-regulator.c @@ -750,23 +750,20 @@ static int bd71828_probe(struct platform_device *pdev) rd = &bd71828_rdata[i]; rdev = devm_regulator_register(&pdev->dev, &rd->desc, &config); - if (IS_ERR(rdev)) { - dev_err(&pdev->dev, - "failed to register %s regulator\n", - rd->desc.name); - return PTR_ERR(rdev); - } + if (IS_ERR(rdev)) + return dev_err_probe(&pdev->dev, PTR_ERR(rdev), + "failed to register %s regulator\n", + rd->desc.name); + for (j = 0; j < rd->reg_init_amnt; j++) { ret = regmap_update_bits(config.regmap, rd->reg_inits[j].reg, rd->reg_inits[j].mask, rd->reg_inits[j].val); - if (ret) { - dev_err(&pdev->dev, - "regulator %s init failed\n", - rd->desc.name); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, + "regulator %s init failed\n", + rd->desc.name); } } return 0; diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c index 00efb18a836c..894fab0d53d0 100644 --- a/drivers/regulator/bd718x7-regulator.c +++ b/drivers/regulator/bd718x7-regulator.c @@ -1576,8 +1576,6 @@ static int setup_feedback_loop(struct device *dev, struct device_node *np, if (!of_node_name_eq(np, desc->of_match)) continue; - pr_info("Looking at node '%s'\n", desc->of_match); - /* The feedback loop connection does not make sense for LDOs */ if (desc->id >= BD718XX_LDO1) return -EINVAL; @@ -1708,20 +1706,17 @@ static int bd718xx_probe(struct platform_device *pdev) break; default: dev_err(&pdev->dev, "Unsupported chip type\n"); - err = -EINVAL; - goto err; + return -EINVAL; } /* Register LOCK release */ err = regmap_update_bits(regmap, BD718XX_REG_REGLOCK, (REGLOCK_PWRSEQ | REGLOCK_VREG), 0); - if (err) { - dev_err(&pdev->dev, "Failed to unlock PMIC (%d)\n", err); - goto err; - } else { - dev_dbg(&pdev->dev, "Unlocked lock register 0x%x\n", - BD718XX_REG_REGLOCK); - } + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to unlock PMIC\n"); + + dev_dbg(&pdev->dev, "Unlocked lock register 0x%x\n", + BD718XX_REG_REGLOCK); use_snvs = of_property_read_bool(pdev->dev.parent->of_node, "rohm,reset-snvs-powered"); @@ -1738,13 +1733,11 @@ static int bd718xx_probe(struct platform_device *pdev) BD718XX_WDOG_POWEROFF_MASK | BD718XX_KEY_L_POWEROFF_MASK, BD718XX_POWOFF_TO_RDY); - if (err) { - dev_err(&pdev->dev, "Failed to change reset target\n"); - goto err; - } else { - dev_dbg(&pdev->dev, - "Changed all resets from SVNS to READY\n"); - } + if (err) + return dev_err_probe(&pdev->dev, err, + "Failed to change reset target\n"); + + dev_dbg(&pdev->dev, "Changed all resets from SVNS to READY\n"); } config.dev = pdev->dev.parent; @@ -1780,13 +1773,10 @@ static int bd718xx_probe(struct platform_device *pdev) desc->ops = swops[i]; rdev = devm_regulator_register(&pdev->dev, desc, &config); - if (IS_ERR(rdev)) { - dev_err(&pdev->dev, - "failed to register %s regulator\n", - desc->name); - err = PTR_ERR(rdev); - goto err; - } + if (IS_ERR(rdev)) + return dev_err_probe(&pdev->dev, PTR_ERR(rdev), + "failed to register %s regulator\n", + desc->name); /* * Regulator register gets the regulator constraints and @@ -1809,28 +1799,23 @@ static int bd718xx_probe(struct platform_device *pdev) !rdev->constraints->boot_on)) { err = regmap_update_bits(regmap, r->init.reg, r->init.mask, r->init.val); - if (err) { - dev_err(&pdev->dev, + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to take control for (%s)\n", desc->name); - goto err; - } } for (j = 0; j < r->additional_init_amnt; j++) { err = regmap_update_bits(regmap, r->additional_inits[j].reg, r->additional_inits[j].mask, r->additional_inits[j].val); - if (err) { - dev_err(&pdev->dev, + if (err) + return dev_err_probe(&pdev->dev, err, "Buck (%s) initialization failed\n", desc->name); - goto err; - } } } -err: return err; } diff --git a/drivers/regulator/bd9576-regulator.c b/drivers/regulator/bd9576-regulator.c index 393c8693b327..02c70768652b 100644 --- a/drivers/regulator/bd9576-regulator.c +++ b/drivers/regulator/bd9576-regulator.c @@ -953,30 +953,28 @@ static int bd957x_probe(struct platform_device *pdev) dev_fwnode(pdev->dev.parent), "rohm,vout1-en", GPIOD_OUT_LOW, "vout1-en"); - if (!IS_ERR(en)) { - /* VOUT1_OPS gpio ctrl */ - /* - * Regulator core prioritizes the ena_gpio over - * enable/disable/is_enabled callbacks so no need to - * clear them. We can still use same ops - */ + + /* VOUT1_OPS gpio ctrl */ + /* + * Regulator core prioritizes the ena_gpio over + * enable/disable/is_enabled callbacks so no need to clear them + * even if GPIO is used. So, we can still use same ops. + * + * In theory it is possible someone wants to set vout1-en LOW + * during OTP loading and set VOUT1 to be controlled by GPIO - + * but control the GPIO from some where else than this driver. + * For that to work we should unset the is_enabled callback + * here. + * + * I believe such case where rohm,vout1-en-low is set and + * vout1-en-gpios is not is likely to be a misconfiguration. + * So let's just err out for now. + */ + if (!IS_ERR(en)) config.ena_gpiod = en; - } else { - /* - * In theory it is possible someone wants to set - * vout1-en LOW during OTP loading and set VOUT1 to be - * controlled by GPIO - but control the GPIO from some - * where else than this driver. For that to work we - * should unset the is_enabled callback here. - * - * I believe such case where rohm,vout1-en-low is set - * and vout1-en-gpios is not is likely to be a - * misconfiguration. So let's just err out for now. - */ - dev_err(&pdev->dev, - "Failed to get VOUT1 control GPIO\n"); - return PTR_ERR(en); - } + else + return dev_err_probe(&pdev->dev, PTR_ERR(en), + "Failed to get VOUT1 control GPIO\n"); } /* @@ -1037,12 +1035,10 @@ static int bd957x_probe(struct platform_device *pdev) r->rdev = devm_regulator_register(&pdev->dev, desc, &config); - if (IS_ERR(r->rdev)) { - dev_err(&pdev->dev, - "failed to register %s regulator\n", - desc->name); - return PTR_ERR(r->rdev); - } + if (IS_ERR(r->rdev)) + return dev_err_probe(&pdev->dev, PTR_ERR(r->rdev), + "failed to register %s regulator\n", + desc->name); /* * Clear the VOUT1 GPIO setting - rest of the regulators do not * support GPIO control diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c index 35d826fe9def..c576894c3d52 100644 --- a/drivers/regulator/lp872x.c +++ b/drivers/regulator/lp872x.c @@ -879,8 +879,9 @@ static struct lp872x_platform_data } #endif -static int lp872x_probe(struct i2c_client *cl, const struct i2c_device_id *id) +static int lp872x_probe(struct i2c_client *cl) { + const struct i2c_device_id *id = i2c_client_get_device_id(cl); struct lp872x *lp; struct lp872x_platform_data *pdata; int ret; @@ -946,7 +947,7 @@ static struct i2c_driver lp872x_driver = { .name = "lp872x", .of_match_table = of_match_ptr(lp872x_dt_ids), }, - .probe = lp872x_probe, + .probe_new = lp872x_probe, .id_table = lp872x_ids, }; diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c index 5e0b669c3a01..460d34c50fb0 100644 --- a/drivers/regulator/ltc3589.c +++ b/drivers/regulator/ltc3589.c @@ -378,9 +378,9 @@ static irqreturn_t ltc3589_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static int ltc3589_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ltc3589_probe(struct i2c_client *client) { + const struct i2c_device_id *id = i2c_client_get_device_id(client); struct device *dev = &client->dev; struct regulator_desc *descs; struct ltc3589 *ltc3589; @@ -476,7 +476,7 @@ static struct i2c_driver ltc3589_driver = { .name = DRIVER_NAME, .of_match_table = of_match_ptr(ltc3589_of_match), }, - .probe = ltc3589_probe, + .probe_new = ltc3589_probe, .id_table = ltc3589_i2c_id, }; module_i2c_driver(ltc3589_driver); diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index 347043a5a9a7..711623be8eb5 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c @@ -367,9 +367,9 @@ static inline int max8660_pdata_from_dt(struct device *dev, } #endif -static int max8660_probe(struct i2c_client *client, - const struct i2c_device_id *i2c_id) +static int max8660_probe(struct i2c_client *client) { + const struct i2c_device_id *i2c_id = i2c_client_get_device_id(client); struct device *dev = &client->dev; struct max8660_platform_data pdata_of, *pdata = dev_get_platdata(dev); struct regulator_config config = { }; @@ -503,7 +503,7 @@ static const struct i2c_device_id max8660_id[] = { MODULE_DEVICE_TABLE(i2c, max8660_id); static struct i2c_driver max8660_driver = { - .probe = max8660_probe, + .probe_new = max8660_probe, .driver = { .name = "max8660", }, diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c index 596cc36aaff6..7e00a45db26a 100644 --- a/drivers/regulator/max8973-regulator.c +++ b/drivers/regulator/max8973-regulator.c @@ -586,9 +586,9 @@ static const struct of_device_id of_max8973_match_tbl[] = { }; MODULE_DEVICE_TABLE(of, of_max8973_match_tbl); -static int max8973_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int max8973_probe(struct i2c_client *client) { + const struct i2c_device_id *id = i2c_client_get_device_id(client); struct max8973_regulator_platform_data *pdata; struct regulator_init_data *ridata; struct regulator_config config = { }; @@ -806,7 +806,7 @@ static struct i2c_driver max8973_i2c_driver = { .name = "max8973", .of_match_table = of_max8973_match_tbl, }, - .probe = max8973_probe, + .probe_new = max8973_probe, .id_table = max8973_id, }; diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c index 7c697bdf344e..da1b2b1341ae 100644 --- a/drivers/regulator/tps62360-regulator.c +++ b/drivers/regulator/tps62360-regulator.c @@ -322,9 +322,9 @@ static const struct of_device_id tps62360_of_match[] = { MODULE_DEVICE_TABLE(of, tps62360_of_match); #endif -static int tps62360_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int tps62360_probe(struct i2c_client *client) { + const struct i2c_device_id *id = i2c_client_get_device_id(client); struct regulator_config config = { }; struct tps62360_regulator_platform_data *pdata; struct regulator_dev *rdev; @@ -497,7 +497,7 @@ static struct i2c_driver tps62360_i2c_driver = { .name = "tps62360", .of_match_table = of_match_ptr(tps62360_of_match), }, - .probe = tps62360_probe, + .probe_new = tps62360_probe, .shutdown = tps62360_shutdown, .id_table = tps62360_id, }; diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index d24333344f93..680a57ff0837 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c @@ -257,9 +257,9 @@ static struct tps_driver_data tps65023_drv_data = { .core_regulator = TPS65023_DCDC_1, }; -static int tps_65023_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int tps_65023_probe(struct i2c_client *client) { + const struct i2c_device_id *id = i2c_client_get_device_id(client); struct regulator_init_data *init_data = dev_get_platdata(&client->dev); struct regulator_config config = { }; struct tps_pmic *tps; @@ -336,7 +336,7 @@ static struct i2c_driver tps_65023_i2c_driver = { .name = "tps65023", .of_match_table = of_match_ptr(tps65023_of_match), }, - .probe = tps_65023_probe, + .probe_new = tps_65023_probe, .id_table = tps_65023_id, }; |