From: Randy Dunlap <rdunlap@xenotime.net>
To: Esben Haabendal <eha@doredevelopment.dk>
Cc: akpm@linux-foundation.org, Richard Purdie <rpurdie@rpsys.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: fix build with CONFIG_LEDS_TRIGGERS disabled
Date: Mon, 9 May 2011 08:51:22 -0700 [thread overview]
Message-ID: <20110509085122.cc5ec6e5.rdunlap@xenotime.net> (raw)
In-Reply-To: <1304932578-14501-1-git-send-email-eha@doredevelopment.dk>
On Mon, 9 May 2011 11:16:18 +0200 Esben Haabendal wrote:
> Add led_get_trigger_data() function for stubbing out access to trigger_data
> when CONFIG_LEDS_TRIGGERS is disabled. This fixes builds with
> CONFIG_LEDS_CLASS enabled, which were broken by
> leds-support-automatic-start-of-blinking-with-ledtrig-timer.patch
>
> Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Thanks.
> ---
> drivers/leds/led-class.c | 2 +-
> drivers/leds/leds.h | 7 +++++++
> 2 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index d7bdef8..dc3d3d8 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -131,7 +131,7 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
> if (!led_cdev->blink_brightness)
> led_cdev->blink_brightness = led_cdev->max_brightness;
>
> - if (led_cdev->trigger_data &&
> + if (led_get_trigger_data(led_cdev) &&
> delay_on == led_cdev->blink_delay_on &&
> delay_off == led_cdev->blink_delay_off)
> return;
> diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h
> index 2dd8ecb..e77c7f8 100644
> --- a/drivers/leds/leds.h
> +++ b/drivers/leds/leds.h
> @@ -40,10 +40,17 @@ void led_trigger_set_default(struct led_classdev *led_cdev);
> void led_trigger_set(struct led_classdev *led_cdev,
> struct led_trigger *trigger);
> void led_trigger_remove(struct led_classdev *led_cdev);
> +
> +static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
> +{
> + return led_cdev->trigger_data;
> +}
> +
> #else
> #define led_trigger_set_default(x) do {} while (0)
> #define led_trigger_set(x, y) do {} while (0)
> #define led_trigger_remove(x) do {} while (0)
> +#define led_get_trigger_data(x) (NULL)
> #endif
>
> ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
> --
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2011-05-09 15:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 23:39 mmotm 2011-05-06-16-39 uploaded akpm
2011-05-07 1:23 ` mmotm 2011-05-06-16-39 uploaded (leds) Randy Dunlap
2011-05-07 6:23 ` Esben Haabendal
2011-05-09 9:16 ` [PATCH] leds: fix build with CONFIG_LEDS_TRIGGERS disabled Esben Haabendal
2011-05-09 15:51 ` Randy Dunlap [this message]
2011-05-07 1:35 ` mmotm 2011-05-06-16-39 uploaded (fs/proc/task_mmu) Randy Dunlap
2011-05-07 5:37 ` Stephen Wilson
2011-05-10 8:57 ` mmotm 2011-05-06-16-39 uploaded KAMEZAWA Hiroyuki
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=20110509085122.cc5ec6e5.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=akpm@linux-foundation.org \
--cc=eha@doredevelopment.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.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).