Re: [NEW DRIVER V4 7/7] DA9058 REGULATOR driver
From: Mark Brown
Date: Fri Apr 12 2013 - 09:26:59 EST
On Fri, Apr 12, 2013 at 02:05:28PM +0100, Anthony Olech wrote:
This looks good, I assume there's some dependencies on the MFD or other
earlier patches so I won't apply it, let me know if there aren't any and
I will:
Acked-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Please use subject lines reflecting the subsystem.
> +static int da9058_buck_ramp_voltage(struct regulator_dev *rdev,
> + unsigned int old_selector,
> + unsigned int new_selector)
> +{
> + struct da9058_regulator *regulator = rdev_get_drvdata(rdev);
> + struct da9058 *da9058 = regulator->da9058;
> + int ret;
> +
> + if (regulator->ramp_register == 0)
> + return -EINVAL;
> +
> + if (regulator->ramp_enable_mask == 0)
> + return -EINVAL;
> +
> + ret = da9058_set_bits(da9058, regulator->ramp_register,
> + regulator->ramp_enable_mask);
> +
> + if (ret)
> + return ret;
> +
> + return 2200; /* micro Seconds needed to ramp to new voltage*/
> +}
Hrm, this really should be implementable with a generic regmap
operation...
> + rdev = regulator_register(®->desc, &config);
> +
> + if (IS_ERR(rdev)) {
> + dev_err(&pdev->dev, "failed to register %s\n",
> + rpdata->regulator_name);
> + ret = PTR_ERR(rdev);
> + goto failed_to_register;
> + }
In general it's a bit better style to print out the return value to help
with diagnosis but it's no big deal.
Attachment:
signature.asc
Description: Digital signature