Re: [PATCH 4/5] platform/x86: x86-android-tablets: Add support for getting serdev-controller by PCI parent

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

 



Hi,

On 10-Nov-24 12:51 PM, Andy Shevchenko wrote:
> On Sun, Nov 10, 2024 at 12:05 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>>
>> On the Vexia EDU ATLA 10 tablet, which ships with Android + a custom Linux
>> (guadalinex) using the custom Android kernel the UART controllers are not
>> enumerated as ACPI devices as they typically are.
>>
>> Instead they are enumerated through PCI and getting the serdev-controller
>> by ACPI HID + UID does not work.
>>
>> Add support for getting the serdev-controller by the PCI devfn of its
>> parent instead.
>>
>> This also renames the use_pci_devname flag to use_pci since the former
>> name now no longer is accurate.
> 
> ...
> 
>> +       if (dev_info->use_pci)
>> +               ctrl_dev = get_serdev_controller_by_pci_parent(info);
>> +       else
>> +               ctrl_dev = get_serdev_controller(info->ctrl_hid, info->ctrl_uid, 0,
>> +                                                info->ctrl_devname);
> 
> I would expect that they both take info as an argument...

The "old" get_serdev_controller() helper for getting the controller
by ACPI HID + UID is also used outside of the x86-android-tablets code
and struct x86_serdev_info is x86-android-tablets specific.

>>         if (IS_ERR(ctrl_dev))
>>                 return PTR_ERR(ctrl_dev);
> 
> ...
> 
>>  struct x86_serdev_info {
>> +       /* For ACPI enumerated controllers */
>>         const char *ctrl_hid;
>>         const char *ctrl_uid;
>> +       /* For PCI enumerated controllers */
>> +       unsigned int ctrl_devfn;
>> +       /* Typically "serial0" */
>>         const char *ctrl_devname;
> 
> Why not union as we have a type selector, i.e. use_pci ?

A union would be possible. I simply did not think of that.

Not sure if it is worth the trouble though, since it saves
only 8 bytes on a struct which is currently used only 3 
times in the driver.

Regards,

Hans









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

  Powered by Linux