mmc: omap_hsmmc: Check if MMC slot name is passed in pdata
authorTony Lindgren <[email protected]>
Tue, 26 Apr 2016 23:46:23 +0000 (16:46 -0700)
committerUlf Hansson <[email protected]>
Mon, 2 May 2016 08:35:45 +0000 (10:35 +0200)
The legacy user space for n900 relies on the MMC slot names.
Let's check if those are passed in pdata and use them.

As this makes the DT booting compatible with legacy booting,
we should be able to start dropping omap3 legacy booting
support in v4.8.

Cc: Ulf Hansson <[email protected]>
Cc: Kishon Vijay Abraham I <[email protected]>
Cc: [email protected]
Signed-off-by: Tony Lindgren <[email protected]>
Tested-by: Ivaylo Dimitrov <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
drivers/mmc/host/omap_hsmmc.c

index e9d75c6dd516f2f62d03e48ef2fa04cdc3c0d2ff..3563321a3cf30f39feffd1168544883330e8e17a 100644 (file)
@@ -1946,13 +1946,17 @@ MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
 
 static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
 {
-       struct omap_hsmmc_platform_data *pdata;
+       struct omap_hsmmc_platform_data *pdata, *legacy;
        struct device_node *np = dev->of_node;
 
        pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
        if (!pdata)
                return ERR_PTR(-ENOMEM); /* out of memory */
 
+       legacy = dev_get_platdata(dev);
+       if (legacy && legacy->name)
+               pdata->name = legacy->name;
+
        if (of_find_property(np, "ti,dual-volt", NULL))
                pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;