Re: [PATCH 02/17] staging: nuc-wmi: detect WMI API detection

Dan Carpenter
2021-05-17T12:21:28Z

On Sun, May 16, 2021 at 12:53:30PM +0200, Mauro Carvalho Chehab wrote:
> - leds = output[0];
> + if (ver != LED_API_NUC6) {
> + ret = nuc_nmi_cmd(dev, LED_VERSION_CONTROL, input, output);

Does this need to be checked?

if (ret)
return ret;

> + ver = output[0] | output[1] << 16;
> + if (!ver)
> + ver = LED_API_REV_0_64;
> + else if (ver == 0x0126)
> + ver = LED_API_REV_1_0;
> + }
> +
> + /* Currently, only API Revision 0.64 is supported */
> + if (ver != LED_API_REV_0_64)
> + return -ENODEV;
> +
> if (!leds) {
> dev_warn(dev, "No LEDs found\n");
> return -ENODEV;

regards,
dan carpenter