[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160919085646.GA2722@kroah.com>
Date: Mon, 19 Sep 2016 10:56:46 +0200
From: Greg KH <greg@...ah.com>
To: Jacek Anaszewski <j.anaszewski@...sung.com>
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
Jacek Anaszewski <jacek.anaszewski@...il.com>
Subject: Re: [PATCH] leds: triggers: Check return value of
kobject_uevent_env()
On Mon, Sep 19, 2016 at 10:22:51AM +0200, Jacek Anaszewski wrote:
> From: Jacek Anaszewski <jacek.anaszewski@...il.com>
>
> Log error message if kobject_uevent_env() fails in led_trigger_set().
>
> Signed-off-by: Jacek Anaszewski <j.anaszewski@...sung.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
Powered by blists - more mailing lists