Re: [PATCH] platform/chrome: cros_ec_lightbar - use name instead of ID to hide lightbar attributes

From: Olof Johansson
Date: Wed May 11 2016 - 15:00:38 EST


On Tue, Mar 08, 2016 at 10:36:24PM -0600, Clinton Sprain wrote:
> Lightbar attributes are hidden if the ID of the device is not 0
> (the assumption being that 0 = cros_ec = might have a lightbar,
> 1 = cros_pd = hide); however, sometimes these devices get IDs 1
> and 2 (or something else) instead of IDs 0 and 1. This prevents
> the lightbar attributes from appearing when they should.
>
> Proposed change is to instead check whether the name assigned to
> the device is CROS_EC_DEV_NAME (true for cros_ec, false for cros_pd).
>
> Signed-off-by: Clinton Sprain <clintonsprain@xxxxxxxxx>

Hm. I wonder why we need to check at all, given that the lightbar version check
is just going to fail later anyway.

Either way, applied with some manual fixups due to surrounding changes.
Apologies for the long delay here.


-Olof