platform: Add platform_find_device_by_driver() helper
[linux-2.6-microblaze.git] / drivers / base / platform.c
index 506a017..a174ce5 100644 (file)
@@ -1197,6 +1197,20 @@ struct bus_type platform_bus_type = {
 };
 EXPORT_SYMBOL_GPL(platform_bus_type);
 
+/**
+ * platform_find_device_by_driver - Find a platform device with a given
+ * driver.
+ * @start: The device to start the search from.
+ * @drv: The device driver to look for.
+ */
+struct device *platform_find_device_by_driver(struct device *start,
+                                             const struct device_driver *drv)
+{
+       return bus_find_device(&platform_bus_type, start, drv,
+                              (void *)platform_match);
+}
+EXPORT_SYMBOL_GPL(platform_find_device_by_driver);
+
 int __init platform_bus_init(void)
 {
        int error;