Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
unsigned int reg;
int ret, i;
unsigned int reg;
int ret, i;
- wm5100 = kzalloc(sizeof(struct wm5100_priv), GFP_KERNEL);
+ wm5100 = devm_kzalloc(&i2c->dev, sizeof(struct wm5100_priv),
+ GFP_KERNEL);
if (wm5100 == NULL)
return -ENOMEM;
if (wm5100 == NULL)
return -ENOMEM;
ret = PTR_ERR(wm5100->regmap);
dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
ret);
ret = PTR_ERR(wm5100->regmap);
dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
ret);
}
for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++)
}
for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++)
wm5100->core_supplies);
err_regmap:
regmap_exit(wm5100->regmap);
wm5100->core_supplies);
err_regmap:
regmap_exit(wm5100->regmap);
-err_alloc:
- kfree(wm5100);
regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies),
wm5100->core_supplies);
regmap_exit(wm5100->regmap);
regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies),
wm5100->core_supplies);
regmap_exit(wm5100->regmap);