Skip to contentSkip to conversation

usb: ehci-vf: use usb_get_dr_mode()

PATCH Mehmet Fide 2 participants 2 messages Oct 18 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

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_UNKNOWN or equivalent undecodable dr_mode made 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

#2 lore raw
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 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 7 lines
Quoted 3 lines

Thus far, USB_DR_MODE_UNKNOWN or equivalent undecodable dr_mode made 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.