lkml.org 
[lkml]   [2022]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/4] ASoC: codecs: add wsa883x amplifier support
From

>>> +static int wsa883x_update_status(struct sdw_slave *slave,
>>> +                 enum sdw_slave_status status)
>>> +{
>>> +    struct wsa883x_priv *wsa883x = dev_get_drvdata(&slave->dev);
>>> +
>>> +    if (status == SDW_SLAVE_ATTACHED && slave->dev_num > 0)
>>
>> do you actually need to test if slave->dev_num is > 0?
>>
> Few years back I think it was you who asked me to add this check.. :-)
>
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2073074.html

Oops!

My comment was valid in general but at the bus level. With the benefit
of hindsight, I don't think this comment is valid in this callback.

update_status is either called with UNATTACHED, or with ATTACHED/ALERT
after programming dev_num to a value > 0.

It's not wrong to leave the code as is, but it's likely to be an
always-true condition.

\
 
 \ /
  Last update: 2022-06-29 18:44    [W:0.050 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site