Re: [PATCH 2/9] regulator: max77802: Add .{get,set}_mode callbacks

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

 




On Wed, Oct 15, 2014 at 06:20:32PM +0200, Javier Martinez Canillas wrote:

> +#define MAX77802_MODE(pval) ((pval == MAX77802_OPMODE_NORMAL) ?	\
> +			     REGULATOR_MODE_NORMAL : REGULATOR_MODE_STANDBY)
> +

Make this a static inline function if there's any need for it, this is
both more legible and more helpful for the compiler.

> +	switch (mode) {
> +	case REGULATOR_MODE_IDLE:
> +	case REGULATOR_MODE_STANDBY:
> +		val = MAX77802_OPMODE_LP;	/* ON in Low Power Mode */
> +		break;

You should never have multiple modes mapping onto a singel value - if
the user sets a mode they should find that the device has that mode.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux