]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ARM: 7422/1: mmc: mmci: Allocate platform memory during Device Tree boot
authorLee Jones <lee.jones@linaro.org>
Tue, 12 Jun 2012 09:49:51 +0000 (10:49 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 14 Jun 2012 14:11:05 +0000 (15:11 +0100)
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>
drivers/mmc/host/mmci.c

index f0fcce40cd8daa27a6a10e44bb28ad9abcf5624d..0045ee001ec752244a541de3e7f111ad826a14fc 100644 (file)
@@ -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);