From: Greg KH <greg@kroah.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
Jacek Anaszewski <jacek.anaszewski@gmail.com>
Subject: Re: [PATCH] leds: triggers: Check return value of kobject_uevent_env()
Date: Mon, 19 Sep 2016 10:56:46 +0200 [thread overview]
Message-ID: <20160919085646.GA2722@kroah.com> (raw)
In-Reply-To: <1474273371-6535-1-git-send-email-j.anaszewski@samsung.com>
On Mon, Sep 19, 2016 at 10:22:51AM +0200, Jacek Anaszewski wrote:
> From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
>
> Log error message if kobject_uevent_env() fails in led_trigger_set().
>
> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
> ---
> drivers/leds/led-triggers.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
> index c7a38d4..f538e8c 100644
> --- a/drivers/leds/led-triggers.c
> +++ b/drivers/leds/led-triggers.c
> @@ -141,7 +141,8 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
> if (event) {
> envp[0] = event;
> envp[1] = NULL;
> - kobject_uevent_env(&led_cdev->dev->kobj, KOBJ_CHANGE, envp);
> + if (kobject_uevent_env(&led_cdev->dev->kobj, KOBJ_CHANGE, envp))
> + pr_err("Error sending uevent after setting LED trigger\n");
You have a device, please use dev_err() for stuff like this, so that you
know what exact device caused the problem.
thanks,
greg k-h
prev parent reply other threads:[~2016-09-19 8:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 8:22 [PATCH] leds: triggers: Check return value of kobject_uevent_env() Jacek Anaszewski
2016-09-19 8:56 ` Greg KH [this message]
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=20160919085646.GA2722@kroah.com \
--to=greg@kroah.com \
--cc=j.anaszewski@samsung.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
/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).