Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbbGFGb1 (ORCPT ); Mon, 6 Jul 2015 02:31:27 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:55118 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbbGFGbT (ORCPT ); Mon, 6 Jul 2015 02:31:19 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-59-559a20b4f5d2 Message-id: <559A20B1.8090703@samsung.com> Date: Mon, 06 Jul 2015 08:31:13 +0200 From: Jacek Anaszewski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-version: 1.0 To: Pavel Machek Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, cooloney@gmail.com, rpurdie@rpsys.net, stsp@users.sourceforge.net, sakari.ailus@linux.intel.com, andreas.werner@men.de, andrew@lunn.ch, ospite@studenti.unina.it, anemo@mba.ocn.ne.jp, ben@simtec.co.uk, bootc@bootc.net, dmurphy@ti.com, daniel.jeong@ti.com, daniel@zonque.org, davem@davemloft.net, fabio.baltieri@gmail.com, balbi@ti.com, florian@openwrt.org, gshark.jeong@gmail.com, g.liakhovetski@gmx.de, ingi2.kim@samsung.com, dl9pf@gmx.de, johan@kernel.org, lenz@cs.wisc.edu, jogo@openwrt.org, q1.kim@samsung.com, kris@krisk.org, kristoffer.ericson@gmail.com, linus.walleij@linaro.org, broonie@kernel.org, michael.hennerich@analog.com, milo.kim@ti.com, nm127@freemail.hu, ncase@xes-inc.com, neilb@suse.de, nick.forbes@incepta.com, lost.distance@yahoo.com, p.meerwald@bct-electronic.com, n0-1@freewrt.org, philippe.retornaz@epfl.ch, raph@8d.com, rpurdie@openedhand.com, rod@whitby.id.au, dave@sr71.net, giometti@linux.it, bigeasy@linutronix.de, shuahkhan@gmail.com, sguinot@lacie.com, kyungmin.park@samsung.com Subject: Re: [PATCH/RFC v3 1/7] leds: Add led_set_brightness_sync to the public LED subsystem API References: <1435929052-8736-1-git-send-email-j.anaszewski@samsung.com> <1435929052-8736-2-git-send-email-j.anaszewski@samsung.com> <20150705123448.GB29782@amd> In-reply-to: <20150705123448.GB29782@amd> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUxTZxSH8973vbeXxmZ3FdmrWyJpshlJ/CBbzPEjDDM334wYDZHFuEyt eAEjRdIKUaMZw25BcdhRwawCGgVrGaLQClhkSFlFLYQpQUUDflHjKB+KBVvwY2uZCf8953ee c84/R8RqLz9H3J6xS9ZnaNM1gpJ43rbdXuCItiQt7jsXBflNJgKdvS4MFeb10PLgR7B6XhIo vlmIocr9NRQ96hfAfek3Di7XeTHkvhkg8JOtmYOSTiOBo5MlPOR7HDwcCKTA+Eg7gZGaMg7q 773FYG48xENDj1+A+9U3BMi9e5iHoD1PAWXXKXTkDirA3erk4ehrKwddzhIBLg5WIwgU1Alg arUrwDpRTWB4eJKA90iLAppO5BB41fEOw2CDh4fJ/EYCBa7Z4L6wCro63ARqHls48LbfQ9B2 7ToHwaaHGBqdXh5GHeMcnO9XwlgwHg4WFJP4z9k7+ynEBrpXsrN9vRx7aTtDWPdEJWYOWw/H yizXCDvz8x+YlecFFGxsdEDBLll6Fez5i02srOIKZrWVBwVmvn2YZ7auh9y6zzYqV2yT07dn y/pFcVuUaQ1jazN94u5fG/OFHDQmHEIRIpW+oOeCF8kUR9G/+87/lytFtVSB6F/Gf/4vniI6 Xj8ctlRSDD0RMHEhJtKn9EqgSxFiQYqlwWe+cD5L2kBfe/7kp/wPacDcF56NlKLpsyErDi3F UodI8/qNONSYKSVTr7c/zGqpHNEHQ2tCHCHNp50XCsM5lpZTW2EdmuK51F41hE1Isky7YZmm WaZpJxGuRLPkrORMw9ZUXexCg1ZnyMpIXZi8U1eLpp7P34BOX13mQpKINDNUG/b9nqTmtdmG PToXoiLWRKpOKy1JatU27Z69sn7nZn1WumxwoY9FovlIVeocWa+WUrW75B2ynCnr33c5MWJO DqJRtZ/MvTqwKm/Hm9VtUUXG9G+ONcWVNp+tbw2cMt+Kj4P20SLfL9+zyKzUbP9ESo1xaenx 2qe9d6TLTzb6yh26+d0kITltib+5+NsU14If9vurcMyXqyvttuaJW+OJOT2JCa90La2jT1zz aMbJgD8xwWpyGr9buxiv+OqDwaW+aA0xpGljY7DeoP0XrJWZm3gDAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 46 On 07/05/2015 02:34 PM, Pavel Machek wrote: > Hi! > >> extern void led_set_brightness(struct led_classdev *led_cdev, >> enum led_brightness brightness); >> + >> +/** >> + * led_set_brightness_sync - set LED brightness synchronously >> + * @led_cdev: the LED to set >> + * @brightness: the brightness to set it to >> + * >> + * Set an LED's brightness immediately. This function will block >> + * the caller for the time required for accessing device register, >> + * and it can sleep. >> + */ >> +static inline int led_set_brightness_sync(struct led_classdev *led_cdev, >> + enum led_brightness value) >> +{ >> + int ret = 0; >> + >> + led_cdev->brightness = min(value, led_cdev->max_brightness); >> + >> + if (led_cdev->flags & LED_SUSPENDED) >> + return 0; >> + >> + if (led_cdev->brightness_set_sync) >> + ret = led_cdev->brightness_set_sync(led_cdev, >> + led_cdev->brightness); >> + else >> + led_cdev->brightness_set(led_cdev, led_cdev->brightness); >> + >> + return 0; >> +} > > return ret, AFAICT? Right, thanks. -- Best Regards, Jacek Anaszewski -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/