Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] HID: logitech-hidpp: avoid duplicate error handling code in 'hidpp_probe()'
@ 2019-12-26 14:54 Christophe JAILLET
  2020-01-13 12:27 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2019-12-26 14:54 UTC (permalink / raw)
  To: jikos, benjamin.tissoires
  Cc: linux-input, linux-kernel, kernel-janitors, Christophe JAILLET

'hid_hw_stop()' is already in the error handling path when branching to
the 'hid_hw_open_fail' label.
There is no point in calling it twice, so remove one.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/hid/hid-logitech-hidpp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index bb063e7d48df..70e1cb928bf0 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -3817,7 +3817,6 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	if (ret < 0) {
 		dev_err(&hdev->dev, "%s:hid_hw_open returned error:%d\n",
 			__func__, ret);
-		hid_hw_stop(hdev);
 		goto hid_hw_open_fail;
 	}
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: logitech-hidpp: avoid duplicate error handling code in 'hidpp_probe()'
  2019-12-26 14:54 [PATCH] HID: logitech-hidpp: avoid duplicate error handling code in 'hidpp_probe()' Christophe JAILLET
@ 2020-01-13 12:27 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2020-01-13 12:27 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: benjamin.tissoires, linux-input, linux-kernel, kernel-janitors

On Thu, 26 Dec 2019, Christophe JAILLET wrote:

> 'hid_hw_stop()' is already in the error handling path when branching to
> the 'hid_hw_open_fail' label.
> There is no point in calling it twice, so remove one.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/hid/hid-logitech-hidpp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index bb063e7d48df..70e1cb928bf0 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -3817,7 +3817,6 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  	if (ret < 0) {
>  		dev_err(&hdev->dev, "%s:hid_hw_open returned error:%d\n",
>  			__func__, ret);
> -		hid_hw_stop(hdev);
>  		goto hid_hw_open_fail;

Thanks for catching this. Applied now.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-26 14:54 [PATCH] HID: logitech-hidpp: avoid duplicate error handling code in 'hidpp_probe()' Christophe JAILLET
2020-01-13 12:27 ` Jiri Kosina

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git