Re: [PATCH] thinkpad_acpi: revert unintentional device attribute renaming

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

 



Henrique de Moraes Holschuh <hmh@xxxxxxxxxx> writes:

> On Tue, May 19, 2015, at 11:13, Bjørn Mork wrote:
>> The conversion to DEVICE_ATTR_* macros failed to fixup a few cases where
>> the old attribute names didn't match the show/store function names.
>> Instead of renaming the functions, the attributes were renamed. This
>> caused an unintentional API change.  The hwmon required 'name' attribute
>> were among the renamed attribute, causing libsensors to fail to detect
>> the hwmon device at all.
>> 
>> Fixes: b4dd04ac6ef8 ("thinkpad_acpi: use DEVICE_ATTR_* macros")
>> Cc: Bastien Nocera <hadess@xxxxxxxxxx>
>> Cc: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
>> Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
>
> ...
>
>> -static ssize_t hotkey_wakeup_reason_show(struct device *dev,
>> +static ssize_t wakeup_reason_show(struct device *dev,
>
> Before, all "hotkey subdriver" functions had the hotkey_ prefix.  Now,
> we have to intrude into whatever "namespace" an attribute name happens
> to clash (in this case, the "wakeup" namespace).
>
> If this is the least horrible way to fix the issue, I will ack it even
> if I don't like it.  However, if there's a way to do it that would keep
> the "hotkey_" prefix in the C side, and only change the rest of the C
> function name (if required), I'd rather the fix did that.

We could use the DEVICE_ATTR(_name, _mode, _show, _store) macro instead
for the affected attributes if you prefer that.

I didn't think the names of these static functions mattered that much,
but I do see that yout have a point for a 10kloc source file like
thinkpad_acpi.c.  You haven't ever considered splitting it? :-)

> Also, the fix needs to go to stable (4.0+).

I don't think so.  The bug was introduced in v4.1-rc1 AFAICS.  Am I
missing something?


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux