[PATCH v2] MAX8952 PMIC Driver Initial Release

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Sep 1 05:48:26 EDT 2010


On Wed, Sep 01, 2010 at 06:44:11PM +0900, Kukjin Kim wrote:

> MM...but I'm not sure if I can submit other patch for max8952...
> Actually, Mr. Ham's max8952 code has been applied by Liam.

We can always remove that if it makes more sense to combine the code.

> -	return (MAX8649_DCDC_VMIN + index * MAX8649_DCDC_STEP);
> +	struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
> +	int ret = MAX8649_DCDC_VMIN + index * MAX8649_DCDC_STEP;
> +
> +	if (!strcmp(info->i2c->name, "max8952"))

Rather than doing a strcmp on the name you should use the id field here:

>  static const struct i2c_device_id max8649_id[] = {
>  	{ "max8649", 0 },
> +	{ "max8952", 0 },
>  	{ }
>  };

to pass in a value which you compare against.  While it's probably not a
performance issue on this chip this is much clearer and more idiomatic.



More information about the linux-arm-kernel mailing list