diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-10-24 18:04:27 -0400 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-10-24 18:04:27 -0400 |
commit | af1bdb79ca64ceadc7b44b11929b384eff66ce59 (patch) | |
tree | c4bb4c94acaf44a113edc60dc0661d4282f0f100 /drivers/of/platform.c | |
parent | 552a79413a691a09abf1b3707561858422afc53c (diff) | |
parent | 1021eb4c454312e65365a4700a1f2b33a0654aa4 (diff) |
Merge branch 'devicetree/arm-linaro-3.1' of git://git.secretlab.ca/git/linux-2.6 into linaro-3.1linux-linaro-3.1-2011.10-2
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r-- | drivers/of/platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index ed5a6d3c26a..b22f8873a41 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -345,6 +345,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 */ @@ -357,6 +358,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; } @@ -366,6 +368,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; |