aboutsummaryrefslogtreecommitdiff
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
authorAndrey Konovalov <andrey.konovalov@linaro.org>2012-01-17 00:05:56 +0400
committerAndrey Konovalov <andrey.konovalov@linaro.org>2012-01-17 00:06:21 +0400
commitb93b9d935637fc8ecc90d163587bd37201de3aed (patch)
tree36c383c4bb9ae0b95b71f853a5b1d5d49116cf1d /drivers/of/platform.c
parentddd06511cec618157b50ffa54c0f0f6ae0f67a01 (diff)
parent027d7c326426cc82f6190ac905f23e061b10de04 (diff)
downloadvexpress-lsk-b93b9d935637fc8ecc90d163587bd37201de3aed.tar.gz
Merge device tree support patches from linux-linaro-3.1
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r--drivers/of/platform.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 63b3ec48c20..7cf22e1f6ed 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -349,6 +349,7 @@ static int of_platform_bus_create(struct device_node *bus,
struct platform_device *dev;
const char *bus_id = NULL;
void *platform_data = NULL;
+ int id = -1;
int rc = 0;
/* Make sure it has a compatible property */
@@ -361,6 +362,7 @@ static int of_platform_bus_create(struct device_node *bus,
auxdata = of_dev_lookup(lookup, bus);
if (auxdata) {
bus_id = auxdata->name;
+ id = auxdata->id;
platform_data = auxdata->platform_data;
}
@@ -370,6 +372,11 @@ static int of_platform_bus_create(struct device_node *bus,
}
dev = of_platform_device_create_pdata(bus, bus_id, platform_data, parent);
+
+ /* override the id if auxdata gives an id */
+ if (id != -1)
+ dev->id = id;
+
if (!dev || !of_match_node(matches, bus))
return 0;