aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8998.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/max8998.c')
-rw-r--r--drivers/regulator/max8998.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index 3027e7ce100b..6b9f262ebbb0 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -309,8 +309,7 @@ static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev,
unsigned selector)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
- struct max8998_platform_data *pdata =
- dev_get_platdata(max8998->iodev->dev);
+ struct max8998_platform_data *pdata = max8998->iodev->pdata;
struct i2c_client *i2c = max8998->iodev->i2c;
int buck = rdev_get_id(rdev);
int reg, shift = 0, mask, ret, j;
@@ -671,8 +670,9 @@ static int max8998_pmic_dt_parse_pdata(struct max8998_dev *iodev,
/* count the number of regulators to be supported in pmic */
pdata->num_regulators = of_get_child_count(regulators_np);
- rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) *
- pdata->num_regulators, GFP_KERNEL);
+ rdata = devm_kcalloc(iodev->dev,
+ pdata->num_regulators, sizeof(*rdata),
+ GFP_KERNEL);
if (!rdata) {
of_node_put(regulators_np);
return -ENOMEM;