]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: musb: dsps: switch to static id for musb-hdrc platform devices
authorBin Liu <b-liu@ti.com>
Thu, 2 Feb 2017 03:30:23 +0000 (21:30 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2017 09:05:11 +0000 (10:05 +0100)
The dsps glue uses PLATFORM_DEVID_AUTO when creating the musb-hdrc
platform devices, this causes that the id will change in each system
depending on the order of driver probe, the order of the usb instances
defined in device-tree, or the list of enabled devices which use also
PLATFORM_DEVID_AUTO in kernel config. This id inconsistency causes
trouble in shell scripting or user guide documentation.

So switch it to static id, starting from 0 to the musb instance with
lower MMR offset. This scheme is also aligned to the naming in the SoC.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_dsps.c

index ceb646be20d924a00b0a594936dbdb3256d67671..9542d20b278533a44206b518d70f592def78e59d 100644 (file)
@@ -695,7 +695,8 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
        resources[1] = *res;
 
        /* allocate the child platform device */
-       musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
+       musb = platform_device_alloc("musb-hdrc",
+                       (resources[0].start & 0xFFF) == 0x400 ? 0 : 1);
        if (!musb) {
                dev_err(dev, "failed to allocate musb device\n");
                return -ENOMEM;