[alsa-devel] [PATCH 1/4 v2] mfd: arizona: Export function to control subsystem DVFS

Mark Brown broonie at kernel.org
Sat Jun 21 22:45:49 CEST 2014


On Fri, Jun 20, 2014 at 03:41:10PM +0100, Charles Keepax wrote:

> +	int ret = 0;

> +			ret = regulator_set_voltage(arizona->dcvdd,
> +						    1800000, 1800000);
> +			if (ret != 0) {
> +				dev_err(arizona->dev,
> +					"Failed to raise dcvdd (%u)\n", ret);
> +				goto err;
> +			}

I'm really nitpicking here but the error code is a signed integer being
printed for some reason with %u and while I'm at it DCVDD would normally
be written in all caps for human consumption.

> +int arizona_dvfs_down(struct arizona *arizona, unsigned int flags)
> +{
> +	int ret = 0;
> +
> +	mutex_lock(&arizona->subsys_max_lock);
> +
> +	arizona->subsys_max_rq &= ~flags;

Is it worth checking to see if the request was asserted and logging a
warning if it wasn't?  The lack of refcounting suggests that a bit of
defensiveness might be in order.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140621/e4be98d2/attachment-0001.sig>


More information about the Alsa-devel mailing list