* [PATCH AUTOSEL 4.20 148/304] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log [not found] <20190128154341.47195-1-sashal@kernel.org> @ 2019-01-28 15:41 ` Sasha Levin 2019-01-28 18:24 ` Dmitry Torokhov 2019-01-28 15:43 ` [PATCH AUTOSEL 4.20 294/304] HID: lenovo: Add checks to fix of_led_classdev_register Sasha Levin 1 sibling, 1 reply; 4+ messages in thread From: Sasha Levin @ 2019-01-28 15:41 UTC (permalink / raw) To: linux-kernel, stable Cc: Uwe Kleine-König, Dmitry Torokhov, Sasha Levin, linux-input From: Uwe Kleine-König <uwe@kleine-koenig.org> [ Upstream commit 0832e93632c61987d504e251b927a2be769dd21a ] When a driver fails to bind because a resource it still missing it's not helpful to report this as (usually) probing is repeated later. Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/input/misc/rotary_encoder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index 30ec77ad32c6..d748897bf5e9 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c @@ -240,8 +240,10 @@ static int rotary_encoder_probe(struct platform_device *pdev) encoder->gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); if (IS_ERR(encoder->gpios)) { - dev_err(dev, "unable to get gpios\n"); - return PTR_ERR(encoder->gpios); + err = PTR_ERR(encoder->gpios); + if (err != -EPROBE_DEFER) + dev_err(dev, "unable to get gpios: %d\n", err); + return err; } if (encoder->gpios->ndescs < 2) { dev_err(dev, "not enough gpios found\n"); -- 2.19.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH AUTOSEL 4.20 148/304] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log 2019-01-28 15:41 ` [PATCH AUTOSEL 4.20 148/304] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log Sasha Levin @ 2019-01-28 18:24 ` Dmitry Torokhov 2019-01-28 19:08 ` Sasha Levin 0 siblings, 1 reply; 4+ messages in thread From: Dmitry Torokhov @ 2019-01-28 18:24 UTC (permalink / raw) To: Sasha Levin; +Cc: linux-kernel, stable, Uwe Kleine-König, linux-input Hi Sasha, On Mon, Jan 28, 2019 at 10:41:05AM -0500, Sasha Levin wrote: > From: Uwe Kleine-König <uwe@kleine-koenig.org> > > [ Upstream commit 0832e93632c61987d504e251b927a2be769dd21a ] > > When a driver fails to bind because a resource it still missing it's not > helpful to report this as (usually) probing is repeated later. I do not think that patch that merely suppresses a harmless warning in dmesg belongs in stable. > > Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > Signed-off-by: Sasha Levin <sashal@kernel.org> > --- > drivers/input/misc/rotary_encoder.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c > index 30ec77ad32c6..d748897bf5e9 100644 > --- a/drivers/input/misc/rotary_encoder.c > +++ b/drivers/input/misc/rotary_encoder.c > @@ -240,8 +240,10 @@ static int rotary_encoder_probe(struct platform_device *pdev) > > encoder->gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); > if (IS_ERR(encoder->gpios)) { > - dev_err(dev, "unable to get gpios\n"); > - return PTR_ERR(encoder->gpios); > + err = PTR_ERR(encoder->gpios); > + if (err != -EPROBE_DEFER) > + dev_err(dev, "unable to get gpios: %d\n", err); > + return err; > } > if (encoder->gpios->ndescs < 2) { > dev_err(dev, "not enough gpios found\n"); > -- > 2.19.1 > Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH AUTOSEL 4.20 148/304] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log 2019-01-28 18:24 ` Dmitry Torokhov @ 2019-01-28 19:08 ` Sasha Levin 0 siblings, 0 replies; 4+ messages in thread From: Sasha Levin @ 2019-01-28 19:08 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: linux-kernel, stable, Uwe Kleine-König, linux-input On Mon, Jan 28, 2019 at 10:24:05AM -0800, Dmitry Torokhov wrote: >Hi Sasha, > >On Mon, Jan 28, 2019 at 10:41:05AM -0500, Sasha Levin wrote: >> From: Uwe Kleine-König <uwe@kleine-koenig.org> >> >> [ Upstream commit 0832e93632c61987d504e251b927a2be769dd21a ] >> >> When a driver fails to bind because a resource it still missing it's not >> helpful to report this as (usually) probing is repeated later. > >I do not think that patch that merely suppresses a harmless warning in >dmesg belongs in stable. I'll drop it. FWIW, my experience with users is that unexplained warnings in dmesg sometimes end up being even more trouble than an actual bug :) -- Thanks, Sasha ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 4.20 294/304] HID: lenovo: Add checks to fix of_led_classdev_register [not found] <20190128154341.47195-1-sashal@kernel.org> 2019-01-28 15:41 ` [PATCH AUTOSEL 4.20 148/304] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log Sasha Levin @ 2019-01-28 15:43 ` Sasha Levin 1 sibling, 0 replies; 4+ messages in thread From: Sasha Levin @ 2019-01-28 15:43 UTC (permalink / raw) To: linux-kernel, stable; +Cc: Aditya Pakki, Jiri Kosina, Sasha Levin, linux-input From: Aditya Pakki <pakki001@umn.edu> [ Upstream commit 6ae16dfb61bce538d48b7fe98160fada446056c5 ] In lenovo_probe_tpkbd(), the function of_led_classdev_register() could return an error value that is unchecked. The fix adds these checks. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/hid/hid-lenovo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index 643b6eb54442..eacc76d2ab96 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -743,7 +743,9 @@ static int lenovo_probe_tpkbd(struct hid_device *hdev) data_pointer->led_mute.brightness_get = lenovo_led_brightness_get_tpkbd; data_pointer->led_mute.brightness_set = lenovo_led_brightness_set_tpkbd; data_pointer->led_mute.dev = dev; - led_classdev_register(dev, &data_pointer->led_mute); + ret = led_classdev_register(dev, &data_pointer->led_mute); + if (ret < 0) + goto err; data_pointer->led_micmute.name = name_micmute; data_pointer->led_micmute.brightness_get = @@ -751,7 +753,11 @@ static int lenovo_probe_tpkbd(struct hid_device *hdev) data_pointer->led_micmute.brightness_set = lenovo_led_brightness_set_tpkbd; data_pointer->led_micmute.dev = dev; - led_classdev_register(dev, &data_pointer->led_micmute); + ret = led_classdev_register(dev, &data_pointer->led_micmute); + if (ret < 0) { + led_classdev_unregister(&data_pointer->led_mute); + goto err; + } lenovo_features_set_tpkbd(hdev); -- 2.19.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-28 19:08 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20190128154341.47195-1-sashal@kernel.org> 2019-01-28 15:41 ` [PATCH AUTOSEL 4.20 148/304] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log Sasha Levin 2019-01-28 18:24 ` Dmitry Torokhov 2019-01-28 19:08 ` Sasha Levin 2019-01-28 15:43 ` [PATCH AUTOSEL 4.20 294/304] HID: lenovo: Add checks to fix of_led_classdev_register Sasha Levin
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).