[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df04d358-f144-47a8-930f-47ccf7cb105a@gmail.com>
Date: Thu, 30 Oct 2025 09:23:45 -0400
From: Brady Norander <bradynorander@...il.com>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
Benson Leung <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH] platform/chrome: cros_ec_lightbar: Check if ec supports
suspend commands
On 10/26/25 23:54, Tzung-Bi Shih wrote:
> On Thu, Oct 23, 2025 at 07:42:40PM -0400, Brady Norander wrote:
>> @@ -550,7 +557,7 @@ static int cros_ec_lightbar_probe(struct platform_device *pd)
>> return -ENODEV;
>>
>> /* Take control of the lightbar from the EC. */
>> - lb_manual_suspend_ctrl(ec_dev, 1);
>> + has_manual_suspend = (lb_manual_suspend_ctrl(ec_dev, 1) >= 0);
>
> The driver doesn't emit an error if lb_manual_suspend_ctrl() returns an
> error in the first place. However, I think `has_manual_suspend` should
> only check for -22. E.g.:
>
> has_manual_suspend = lb_manual_suspend_ctrl(...) != -EINVAL;
Thanks for the review.
I originally decided to catch all errors to be on the safe side. After
thinking about it some more, I agree that it should only check for
-EINVAL. Will send a v2.
Powered by blists - more mailing lists