When setting up HSMMC devices, pass the device nodes back so
board code can linking them to their power supply regulators.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/regulator/machine.h>
 
 #include <mach/hardware.h>
 #include <mach/control.h>
        }
 
        omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC);
+
+       /* pass the device nodes back to board setup code */
+       for (c = controllers; c->mmc; c++) {
+               struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1];
+
+               if (!c->mmc || c->mmc > nr_hsmmc)
+                       continue;
+               c->dev = mmc->dev;
+       }
 }
 
 #endif
 
        bool    ext_clock;      /* use external pin for input clock */
        int     gpio_cd;        /* or -EINVAL */
        int     gpio_wp;        /* or -EINVAL */
+       struct device *dev;     /* returned: pointer to mmc adapter */
 };
 
 #if    defined(CONFIG_TWL4030_CORE) && \
 
        ret = platform_device_add(pdev);
        if (ret)
                goto fail;
+
+       /* return device handle to board setup code */
+       data->dev = &pdev->dev;
        return 0;
 
 fail:
 
 #define OMAP_MMC_MAX_SLOTS     2
 
 struct omap_mmc_platform_data {
+       /* back-link to device */
+       struct device *dev;
 
        /* number of slots per controller */
        unsigned nr_slots:2;