Re: [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
From: Elson Serrao
Date: Wed Mar 11 2026 - 18:58:18 EST
On 3/11/2026 6:16 AM, Greg Kroah-Hartman wrote:
[...]
>> +
>> +What: /sys/bus/platform/drivers/qcom_eud/.../port
>> +Date: January 2026
>> +Contact: Elson Serrao <elson.serrao@xxxxxxxxxxxxxxxx>
>> +Description:
>> + Selects which USB port the Embedded USB Debugger (EUD)
>> + is mapped to on platforms providing multiple High-Speed
>> + USB ports.
>> +
>> + Valid values:
>> + 0 - Primary USB port
>> + 1 - Secondary USB port
>
> Why not use "primary" and "secondary" as values instead? That makes
> this much simpler to understand.
>
[...]
>>
>> +static ssize_t port_show(struct device *dev,
>> + struct device_attribute *attr, char *buf)
>> +{
>> + struct eud_chip *chip = dev_get_drvdata(dev);
>> +
>> + return sysfs_emit(buf, "%u\n", chip->port_idx);
>
> Wait, you are returning a 0/1 here, yet using a u8? How can that work?
>
Thanks for the review, Greg.
I’ll switch the sysfs attribute to use "primary"/"secondary" values
(instead of numeric 0/1) as suggested and update the ABI doc and driver.
This should also resolve the ambiguity around the current 0/1 output.
Regards,
Elson