linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	sakari.ailus@linux.intel.com, stsp@users.sourceforge.net,
	pavel@ucw.cz, ospite@studenti.unina.it, davem@davemloft.net,
	linus.walleij@linaro.org, ricardo.ribalda@gmail.com,
	p.meerwald@bct-electronic.com
Subject: Re: [PATCH 4/5] leds: core: Add an internal led_set_brightness_nosleep function
Date: Wed, 23 Sep 2015 10:53:49 +0200	[thread overview]
Message-ID: <5602689D.2080604@samsung.com> (raw)
In-Reply-To: <20150922190243.GD20029@lunn.ch>

On 09/22/2015 09:02 PM, Andrew Lunn wrote:
>> +void led_set_brightness_nosleep(struct led_classdev *led_cdev,
>> +					enum led_brightness value)
>> +{
>> +	led_cdev->brightness = min(value, led_cdev->max_brightness);
>> +
>> +	if (led_cdev->flags & LED_SUSPENDED)
>> +		return;
>> +
>> +	/* Use brightness_set op if available, it is guaranteed not to sleep */
>> +	if (led_cdev->brightness_set)
>> +		led_cdev->brightness_set(led_cdev, led_cdev->brightness);
>> +
>> +	/* If brightness setting can sleep, delegate it to a work queue task */
>> +	led_cdev->delayed_set_value = led_cdev->brightness;
>> +	schedule_work(&led_cdev->set_brightness_work);
>> +}
>
> To me, it looks like there is a missing else, or return here. We don't
> want both led_cdev->brightness_set() and the work queue.

Thanks for spotting this.

>> +EXPORT_SYMBOL(led_set_brightness_nosleep);
>
> There seems to be a mixture of EXPORT_SYMBOL and
> EXPORT_SYMBOL_GPL. Have you figured out the pattern? led-class.c seems
> to be all _GPL, but led-core.c has a mixture.

In fact, this is weird. I didn't pay sufficient attention to this,
I must admit. We should switch to using EXPORT_SYMBOL_GPL consequently [1].

[1] https://lwn.net/Articles/603187/

-- 
Best Regards,
Jacek Anaszewski

  reply	other threads:[~2015-09-23  8:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 10:47 [PATCH 0/5] LED core improvements Jacek Anaszewski
2015-09-16 10:47 ` [PATCH 1/5] leds: core: Move LED core callbacks out of led-class.c Jacek Anaszewski
2015-09-22 19:06   ` Andrew Lunn
2015-10-06 15:31   ` Pavel Machek
2015-10-07  7:29     ` Jacek Anaszewski
2015-09-16 10:47 ` [PATCH 2/5] leds: core: Add LED_BLINK_CHANGE and LED_BLINK_DISABLE flags Jacek Anaszewski
2015-09-22 18:44   ` Andrew Lunn
2015-09-23  8:07     ` Jacek Anaszewski
2015-10-06 15:35   ` Pavel Machek
2015-09-16 10:47 ` [PATCH 3/5] leds: Rename brightness_set_sync op to brightness_set_blocking Jacek Anaszewski
2015-09-22 18:54   ` Andrew Lunn
2015-09-23  8:36     ` Jacek Anaszewski
2015-09-23  9:34       ` Jacek Anaszewski
2015-10-06 15:36   ` Pavel Machek
2015-09-16 10:47 ` [PATCH 4/5] leds: core: Add an internal led_set_brightness_nosleep function Jacek Anaszewski
2015-09-22 19:02   ` Andrew Lunn
2015-09-23  8:53     ` Jacek Anaszewski [this message]
2015-09-16 10:47 ` [PATCH 5/5] leds: core: Use set_brightness_work for the blocking op Jacek Anaszewski
2015-09-22  8:03   ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5602689D.2080604@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=ospite@studenti.unina.it \
    --cc=p.meerwald@bct-electronic.com \
    --cc=pavel@ucw.cz \
    --cc=ricardo.ribalda@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stsp@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).