[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6d063681-03d5-4270-9fe6-7879fc019382@roeck-us.net>
Date: Mon, 13 May 2024 12:37:26 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Marius Zachmann <mail@...iuszachmann.de>
Cc: Jean Delvare <jdelvare@...e.com>, Jonathan Corbet <corbet@....net>,
linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] hwmon: (corsair-cpro) Add firmware and bootloader
information
On Mon, May 13, 2024 at 09:25:38PM +0200, Marius Zachmann wrote:
[ ...]
>
> +/* read firmware version */
> +static int get_fw_version(struct ccp_device *ccp)
> +{
> + int ret;
> +
> + ret = send_usb_cmd(ccp, CTL_GET_FW_VER, 0, 0, 0);
> + if (ret) {
> + hid_notice(ccp->hdev, "Failed to read firmware version.\n");
Please use the following pattern:
if (ret) {
hid_notice(ccp->hdev, "Failed to read firmware version.\n");
return ret;
}
ccp->firmware_ver[0] = ccp->buffer[1];
ccp->firmware_ver[1] = ccp->buffer[2];
ccp->firmware_ver[2] = ccp->buffer[3];
return 0;
Thanks,
Guenter
Powered by blists - more mailing lists