Re: [PATCH] regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 23, 2012 at 01:05:09PM +0200, Tero Kristo wrote:

> +static int twl6030coresmps_set_voltage(struct regulator_dev *rdev, int min_uV,
> +	int max_uV, unsigned *selector)
> +{
> +	struct twlreg_info *info = rdev_get_drvdata(rdev);
> +
> +	if (info->set_voltage)
> +		return info->set_voltage(info->data, min_uV);
> +
> +	return 0;
> +}

This should be returning an error if it failed to set the voltage.
Since you're using min_uV as the "register value" you probably ought to
be returning that as the selector too and supplying a list_voltage()
which just passes the selector back in case something tries to use it
and gets confused.

> +static int twl6030coresmps_get_voltage(struct regulator_dev *rdev)
> +{
> +	struct twlreg_info *info = rdev_get_drvdata(rdev);
> +
> +	if (info->get_voltage)
> +		return info->get_voltage(info->data);
> +
> +	return 0;

Similarly here.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux