summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-06-12 10:49:51 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-06-14 15:11:05 +0100
commitb9b52918abe88d9135dd570fb394b9c432eb1cfd (patch)
treeed03ec637ccf95b1a3600c5c52dac5842f050982 /drivers/mmc/host/mmci.c
parentf8f5701bdaf9134b1f90e5044a82c66324d2073f (diff)
downloadop-kernel-dev-b9b52918abe88d9135dd570fb394b9c432eb1cfd.zip
op-kernel-dev-b9b52918abe88d9135dd570fb394b9c432eb1cfd.tar.gz
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/host/mmci.c')
-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 f0fcce4..0045ee0 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);
OpenPOWER on IntegriCloud