usb: ehci-vf: use usb_get_dr_mode()
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Marek,
Quoted 3 lines · Marek Vasut
Please split this into two patches:
- First - only the macro replacements
- Second - any additional clean ups
Will do in v7: the first patch only replaces the private enum and the strcmp() chain with usb_get_dr_mode(), the second moves the ID detect gpio request to the device.
Quoted 5 lines
This has to check return value,
gpio_request_by_name()can return negative error.This has to check return value,
dm_gpio_get_value()can return negative error.
Both checked in v7; only -ENOENT from the request is tolerated, as the property is optional, and keeps the port in device mode as before.
Quoted 3 lines
Thus far,
USB_DR_MODE_UNKNOWNor equivalent undecodabledr_modemade this function return-EINVAL...
... Now it seems to be handled as host ?
Yes, v6 changed that by mistake. v7 keeps the old behaviour: a missing property means host, a value the driver does not know fails with -EINVAL.
Thanks,
Mehmet
Quoted 20 lines · Mehmet Fide
Hi Marek,
Quoted 3 lines · Marek Vasut
Please split this into two patches:
- First - only the macro replacements
- Second - any additional clean upsWill do in v7: the first patch only replaces the private enum and the
strcmp()chain withusb_get_dr_mode(), the second moves the ID detect gpio request to the device.Quoted 5 lines
This has to check return value,
gpio_request_by_name()can return negative error.This has to check return value,
dm_gpio_get_value()can return negative error.Both checked in v7; only
-ENOENTfrom the request is tolerated, as the property is optional, and keeps the port in device mode as before.
Quoted 7 lines
Quoted 3 lines
Thus far,
USB_DR_MODE_UNKNOWNor equivalent undecodabledr_modemade this function return-EINVAL...
... Now it seems to be handled as host ?Yes, v6 changed that by mistake. v7 keeps the old behaviour: a missing property means host, a value the driver does not know fails with
-EINVAL.
Thank you.