Re: [PATCH v2 01/16] leds: triggers: let struct led_trigger::activate return an error code

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

 



Hi!

> On Thu, May 24, 2018 at 01:54:26PM +0200, Pavel Machek wrote:
> > > Given that activating a trigger can fail, let the callback return an
> > > indication. This prevents to have a trigger active according to the
> > > "trigger" sysfs attribure but not functional.
> > > 
> > > This is done using a new function callback .new_activate to not break
> > > existing drivers and to allow to convert one after the other to the new
> > > mechanism. Once all users are converted, .activate can be dropped and
> > > .new_activate renamed.
> > 
> > No, this is not reasonable.
> > 
> > Instead of big rename, replace return value in ->activate with int. It
> > will currently return 0 for all drivers.
> 
> No, currently the .activate callbacks "return" void, which e.g. on ARM
> means that the r0 register (which holds the return value when the return
> type is int) contains an unspecified value which most of the time is not
> zero.

Yes, you need to change the .activate callbacks to return int (and add
return 0 there).

Yes, it will touch all triggers, but so would your proposal of "Once
all users are converted, .activate can be dropped and .new_activate
renamed.". Better do it now.

Thanks,
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux