Re: [PATCH 2/4] ASoC: codecs: add wsa883x amplifier support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> +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@xxxxxxxxxxxxxxx/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.



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux