Re: [RFC PATCH RESEND 2/3] leds: upboard: Add LED support

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

 



Hi Pavel,

On Wed, Apr 25, 2018 at 08:41:33AM +0200, Pavel Machek wrote:
> On Sat 2018-04-21 09:50:08, Javier Arteaga wrote:
> > Allow userspace to use the on-board LEDs as "upboard:<color>:".
> > 
> > Signed-off-by: Javier Arteaga <javier@xxxxxxxxxx>
> 
> > +static enum led_brightness upboard_led_brightness_get(struct led_classdev *cdev)
> > +{
> > +	struct upboard_led *led = container_of(cdev, struct upboard_led, cdev);
> > +	int brightness = 0;
> > +
> > +	regmap_field_read(led->field, &brightness);
> > +
> > +	return brightness;
> > +};
> 
> I'm slightly confused here. Is each led controlled by single bit?

Yes. Each regmap field is one bit wide.

> What is going on with ";" at end of function? We don't do that.

Huh, I totally missed this. It's all throughout the patchset too, and
it's going away in v2 of course.

> If it is single bit, max_brightness should be one, and != LED_OFF test
> should not be needed.

Got it. Will do for v2.

Thanks for your time!



[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