[PATCH v1] nubus: Remove redunant driver match function

Lizhe posted 1 patch 1 year ago
drivers/nubus/bus.c | 6 ------
1 file changed, 6 deletions(-)
[PATCH v1] nubus: Remove redunant driver match function
Posted by Lizhe 1 year ago
If there is no driver match function, the driver core assumes that each
candidate pair (driver, device)matches, see driver_match_device()

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/nubus/bus.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c
index 17fad660032c..72921e4f35f6 100644
--- a/drivers/nubus/bus.c
+++ b/drivers/nubus/bus.c
@@ -14,11 +14,6 @@
 #define to_nubus_board(d)       container_of(d, struct nubus_board, dev)
 #define to_nubus_driver(d)      container_of(d, struct nubus_driver, driver)
 
-static int nubus_bus_match(struct device *dev, struct device_driver *driver)
-{
-	return 1;
-}
-
 static int nubus_device_probe(struct device *dev)
 {
 	struct nubus_driver *ndrv = to_nubus_driver(dev->driver);
@@ -39,7 +34,6 @@ static void nubus_device_remove(struct device *dev)
 
 struct bus_type nubus_bus_type = {
 	.name		= "nubus",
-	.match		= nubus_bus_match,
 	.probe		= nubus_device_probe,
 	.remove		= nubus_device_remove,
 };
-- 
2.34.1
Re: [PATCH v1] nubus: Remove redunant driver match function
Posted by Finn Thain 1 year ago
Hi Lizhe,

On Sun, 19 Mar 2023, Lizhe wrote:

> If there is no driver match function, the driver core assumes that each
> candidate pair (driver, device)matches, see driver_match_device()
> 

As it happens, the same patch from a different author was accepted last 
week.

https://lore.kernel.org/linux-m68k/CAMuHMdXQPh0BaQA1csgJbPxjorY15-V9=jb7ZL8Yq24Qe7k9jQ@mail.gmail.com/T/#t