[PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500

Lee Jones
2012-06-11T10:03:26Z

> Lee can you provide an incremental fixup that makes the current
> code textually equivalent to what Russell ACKed (devm_kzalloc()),
> and funnel to Chris for the -rc:s ASAP?

Your wish is my command:

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 11 Jun 2012 10:41:00 +0100
Subject: [PATCH] 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.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mmc/host/mmci.c | 6 ++++++
1 file changed, 6 insertions(+)

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);

--
1.7.9.5