Re: [PATCH v5 02/16] usb: assign default peer ports for root hubs

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

 



On Tue, Feb 25, 2014 at 12:20 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, 24 Feb 2014, Dan Williams wrote:
>
>> @@ -163,12 +227,18 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1)
>>       port_dev->dev.parent = hub->intfdev;
>>       port_dev->dev.groups = port_dev_group;
>>       port_dev->dev.type = &usb_port_device_type;
>> -     dev_set_name(&port_dev->dev, "port%d", port1);
>> -
>> +     dev_set_name(&port_dev->dev, "%s-port%d", dev_name(&hub->hdev->dev),
>> +                     port1);
>
> By the way, check out the usage of sscanf in usb_acpi_find_companion().

Cute.

> It seems like a bad idea; better just to store the port number in the
> port structure.

Yes, just use to_usb_port(dev)->portnum.

> PS: Why are the usb_get_hub_port_connect_type() call and following
> material in that routine?  Why isn't they in usb_new_device() instead?

No reason I can see.  By the time the usb_device is doing its acpi
lookup the port connect_type is already set.  I'll take care of
cleaning that up.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux