Commit 22714a10 authored by Patrick Mochel's avatar Patrick Mochel

driver model: fix platform_match()

- Make it compare the name in struct platform_dev to the driver's name.

From Dominik Brodowski
parent 230b17f6
...@@ -59,12 +59,9 @@ void platform_device_unregister(struct platform_device * pdev) ...@@ -59,12 +59,9 @@ void platform_device_unregister(struct platform_device * pdev)
static int platform_match(struct device * dev, struct device_driver * drv) static int platform_match(struct device * dev, struct device_driver * drv)
{ {
char name[BUS_ID_SIZE]; struct platform_device *pdev = container_of(dev, struct platform_device, dev);
if (sscanf(dev->bus_id,"%s",name)) return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
return (strcmp(name,drv->name) == 0);
return 0;
} }
struct bus_type platform_bus_type = { struct bus_type platform_bus_type = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment