Skip to contentSkip to conversation

scsi: scsi_debug: Remove redundant driver match function

PATCH Applied Lizhe 3 participants 3 messages Mar 19, 2023 – Mar 24, 2023 SCSI

lore
Share & tools
lore

Lizhe

author
#0 lore raw

PATCH 1/1 scsi: scsi_debug: Remove redundant driver match function

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

Drop the pseudo_lld bus's match function that always returned 1 and so implements the same behaviour as when there is no match function.

---
 drivers/scsi/scsi_debug.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/scsi/scsi_debug.c +0 -7
index 8553277effb3..fa6f150b7364 100644
@@ -7950,15 +7950,8 @@ static void sdebug_driver_remove(struct device *dev)
 	scsi_host_put(sdbg_host->shost);
 }
 
-static int pseudo_lld_bus_match(struct device *dev,
-				struct device_driver *dev_driver)
-{
-	return 1;
-}
-
 static struct bus_type pseudo_lld_bus = {
 	.name = "pseudo",
-	.match = pseudo_lld_bus_match,
 	.probe = sdebug_driver_probe,
 	.remove = sdebug_driver_remove,
 	.drv_groups = sdebug_drv_groups,
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Lizhe

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

Drop the pseudo_lld bus's match function that always returned 1 and so

I'd have "Drop the pseudo_lld_bus match function .."

Quoted 4 lines

implements the same behaviour as when there is no match function.

---

#2 lore raw
In reply to Lizhe

Lizhe,

Quoted 5 lines

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

Drop the pseudo_lld bus's match function that always returned 1 and so implements the same behaviour as when there is no match function.

Applied to 6.4/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering