summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-06-12 13:49:51 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-06-14 18:11:05 +0400
commitb9b52918abe88d9135dd570fb394b9c432eb1cfd (patch)
treeed03ec637ccf95b1a3600c5c52dac5842f050982 /drivers/mmc
parentf8f5701bdaf9134b1f90e5044a82c66324d2073f (diff)
downloadlinux-b9b52918abe88d9135dd570fb394b9c432eb1cfd.tar.xz
ARM: 7422/1: mmc: mmci: Allocate platform memory during Device Tree boot
When booting with Device Tree enabled, platform specific information is gathered by parsing the DT binary. Platform data is subsequently populated with the result. The memory required for this is not automatically allocated during Device Tree boot, so we'll do it here instead. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index f0fcce40cd8d..0045ee001ec7 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1276,6 +1276,12 @@ static int __devinit mmci_probe(struct amba_device *dev,
return -EINVAL;
}
+ if (!plat) {
+ plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL);
+ if (!plat)
+ return -ENOMEM;
+ }
+
if (np)
mmci_dt_populate_generic_pdata(np, plat);