X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fbase%2Fplatform.c;h=c6c933f58102370d8ed738e2778cb11dad2e93fb;hb=ab69bcd66fb4be64edfc767365cb9eb084961246;hp=1bb8faaa443fc435346de1861c1e4ed556d4edb1;hpb=6937e8f8c0135f2325194c372ada6dc655499992;p=mv-sheeva.git diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 1bb8faaa443..c6c933f5810 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -583,6 +584,12 @@ static struct device_attribute platform_dev_attrs[] = { static int platform_uevent(struct device *dev, struct kobj_uevent_env *env) { struct platform_device *pdev = to_platform_device(dev); + int rc; + + /* Some devices have extra OF data and an OF-style MODALIAS */ + rc = of_device_uevent(dev,env); + if (rc != -ENODEV) + return rc; add_uevent_var(env, "MODALIAS=%s%s", PLATFORM_MODULE_PREFIX, (pdev->id_entry) ? pdev->id_entry->name : pdev->name); @@ -621,7 +628,11 @@ static int platform_match(struct device *dev, struct device_driver *drv) struct platform_device *pdev = to_platform_device(dev); struct platform_driver *pdrv = to_platform_driver(drv); - /* match against the id table first */ + /* Attempt an OF style match first */ + if (of_driver_match_device(dev, drv)) + return 1; + + /* Then try to match against the id table */ if (pdrv->id_table) return platform_match_id(pdrv->id_table, pdev) != NULL;