Re: [Patch 06/06] Regulator: DA9052/53 Regulator support v5

From: Mark Brown
Date: Wed Dec 14 2011 - 13:02:54 EST


On Fri, Dec 09, 2011 at 07:48:20PM +0530, Ashish Jangam wrote:
> The Dialog PMIC has below featured regulators:-
> DA9052-BC - 4 DVS Buck converters 0.5V - 3.6V upto 1Amp.
> DA9053-AA/BX - 4 DVS Buck converters 0.5V - 2.5V upto 3Amp.
> DA9052/53 - 10 Programmable LDO's High PSSR, 1% accuracy.

Applied but there are some small issues - please send incremental
patches fixing these.

> + if (chip_id == DA9052) {
> + for (i = 0; i < ARRAY_SIZE(da9052_regulator_info); i++) {
> + info = &da9052_regulator_info[i];
> + if (info->reg_desc.id == id)
> + return info;
> + }
> + } else {
> + for (i = 0; i < ARRAY_SIZE(da9053_regulator_info); i++) {
> + info = &da9053_regulator_info[i];
> + if (info->reg_desc.id == id)
> + return info;
> + }
> + }

This would be better written as a switch statement.

> + regulator = kzalloc(sizeof(struct da9052_regulator), GFP_KERNEL);
> + if (!regulator)
> + return -ENOMEM;

You should use devm_kzalloc().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/