linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-input@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 2/7] HID: lenovo: Fix lenovo_led_set_tp10ubkbd() error handling
Date: Sun, 21 Feb 2021 02:37:31 +0100	[thread overview]
Message-ID: <20210221023731.616e20ba@kernel.org> (raw)
In-Reply-To: <20210220122438.21857-3-hdegoede@redhat.com>

On Sat, 20 Feb 2021 13:24:33 +0100
Hans de Goede <hdegoede@redhat.com> wrote:

> Fix the following issues with lenovo_led_set_tp10ubkbd() error handling:
> 
> 1. On success hid_hw_raw_request() returns the number of bytes send.

bytes sent

> @@ -75,10 +75,12 @@ static void lenovo_led_set_tp10ubkbd(struct hid_device *hdev, u8 led_code,
>  	data->led_report[2] = value ? TP10UBKBD_LED_ON : TP10UBKBD_LED_OFF;
>  	ret = hid_hw_raw_request(hdev, data->led_report[0], data->led_report, 3,
>  				 HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
> -	if (ret)
> +	if (ret != 3 && ret != -ENODEV)
>  		hid_err(hdev, "Set LED output report error: %d\n", ret);
>  
>  	mutex_unlock(&data->led_report_mutex);
> +
> +	return ret < 0 ? ret : 0;

So if ret == 2, it will log error but return 0. I think in that case it
should return -EIO.

  reply	other threads:[~2021-02-21  1:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 12:24 [PATCH v2 0/7] HID: lenovo: Mute LED handling fixes and improvements Hans de Goede
2021-02-20 12:24 ` [PATCH v2 1/7] HID: lenovo: Use brightness_set_blocking callback for setting LEDs brightness Hans de Goede
2021-02-21  1:26   ` Marek Behún
2021-02-23  8:59   ` Pavel Machek
2021-02-20 12:24 ` [PATCH v2 2/7] HID: lenovo: Fix lenovo_led_set_tp10ubkbd() error handling Hans de Goede
2021-02-21  1:37   ` Marek Behún [this message]
2021-02-20 12:24 ` [PATCH v2 3/7] HID: lenovo: Check hid_get_drvdata() returns non NULL in lenovo_event() Hans de Goede
2021-02-21  1:39   ` Marek Behún
2021-02-20 12:24 ` [PATCH v2 4/7] HID: lenovo: Remove lenovo_led_brightness_get() Hans de Goede
2021-02-21  1:39   ` Marek Behún
2021-02-20 12:24 ` [PATCH v2 5/7] HID: lenovo: Set LEDs max_brightness value Hans de Goede
2021-02-20 15:16   ` Marek Behun
2021-02-20 16:34     ` Hans de Goede
2021-02-20 16:47       ` Marek Behun
2021-02-20 12:24 ` [PATCH v2 6/7] HID: lenovo: Map mic-mute button to KEY_F20 instead of KEY_MICMUTE Hans de Goede
2021-02-21  1:42   ` Marek Behun
2021-02-21 10:42     ` Hans de Goede
2021-02-21 11:37       ` Marek Behún
2021-02-21 11:50         ` Hans de Goede
2021-02-20 12:24 ` [PATCH v2 7/7] HID: lenovo: Set default_trigger-s for the mute and micmute LEDs Hans de Goede
2021-02-21  1:43   ` Marek Behun

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=20210221023731.616e20ba@kernel.org \
    --to=kabel@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@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).