Skip to contentSkip to conversation

driver core:fix driver_match_device

PATCH In review [email protected] 3 participants 3 messages Mar 27, 2009 – Apr 17, 2009 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core:fix driver_match_device

From: Ming Lei <[email protected]>

This patch fixes a bug introduced in commit
49b420a13ff95b449947181190b08367348e3e1b.

If a instance of bus_type doesn't have .match method, all .probe of drivers in the bus should be called, or else the .probe have not a chance to be called.

---
 drivers/base/base.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/base.h +1 -1
index ddc9749..b528145 100644
@@ -115,7 +115,7 @@ extern int driver_probe_device(struct device_driver *drv, struct device *dev);
 static inline int driver_match_device(struct device_driver *drv,
 				      struct device *dev)
 {
-	return drv->bus->match && drv->bus->match(dev, drv);
+	return drv->bus->match ? drv->bus->match(dev, drv) : 1;
 }
 
 extern void sysdev_shutdown(void);
Signature · 1 line
1.6.0.GIT
#1 lore raw
Quoted 11 lines · On Fri, 27 Mar 2009, [email protected] wrote:

From: Ming Lei <[email protected]>

This patch fixes a bug introduced in commit
49b420a13ff95b449947181190b08367348e3e1b.

If a instance of bus_type doesn't have .match method, all .probe of drivers in the bus should be called, or else the .probe have not a chance to be called.

It looks like this patch is _still_ not in the mainline - now that we are past rc2... Unless the problem has been fixed differently (I haven't tested recent kernels), can we __please__ get it upstream?

Thanks
Guennadi

Quoted 20 lines
---
 drivers/base/base.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/base.h +1 -1
index ddc9749..b528145 100644
@@ -115,7 +115,7 @@ extern int driver_probe_device(struct device_driver *drv, struct device *dev);
 static inline int driver_match_device(struct device_driver *drv,
 				      struct device *dev)
 {
-	return drv->bus->match && drv->bus->match(dev, drv);
+	return drv->bus->match ? drv->bus->match(dev, drv) : 1;
 }
 
 extern void sysdev_shutdown(void);
Signature · 1 line
1.6.0.GIT

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

#2 lore raw
Quoted 11 lines · Guennadi Liakhovetski
Quoted 9 lines · On Fri, 27 Mar 2009, [email protected] wrote:

From: Ming Lei <[email protected]>

This patch fixes a bug introduced in commit
49b420a13ff95b449947181190b08367348e3e1b.

If a instance of bus_type doesn't have .match method, all .probe of drivers in the bus should be called, or else the .probe have not a chance to be called.

Quoted 6 lines
Quoted 2 lines

It looks like this patch is _still_ not in the mainline - now that we are past rc2... Unless the problem has been fixed differently (I haven't tested recent kernels), can we __please__ get it upstream?

It's in my queue to go to Linus today.

thanks,

greg k-h