Re: [PATCH 05/29] regulator: use IS_ERR_OR_NULL() instead of open-coding

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

 



On Mon, Jun 11, 2012 at 02:06:29PM +0200, Guennadi Liakhovetski wrote:
> On Mon, 11 Jun 2012, Mark Brown wrote:

> > The stubs return NULL and we could decide in future to use NULL for
> > something else (though that seems unlikely).

> Ah, sure, forgot about that, sorry. In fact, I was wondering, whether it's 
> indeed a good idea to return success from functions like 
> regulator_set_voltage() or regulator_get_voltage() when regulator is even 
> not configured? Isn't it confusing for drivers to get a success from 

Anything that really cares about set_voltage() should have a hard
dependency on the API, it's mainly done so that cpufreq type drivers
can work easily (since they don't *really* care about the voltages
normally, generally if nothing happens in the regulator they're just
less effective).

> set_voltage(voltage > 0) and then get 0V back from get_voltage()?

There's not a use case I can think of for this, though.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux