Skip to contentSkip to conversation

s390/vfio-ap-drv: Remove redundant driver match function

PATCH Applied Lizhe 3 participants 3 messages Mar 19, 2023 – Mar 21, 2023

Subsystems (3)
lore
Share & tools
lore

Lizhe

author
#0 lore raw

PATCH 1/1 s390/vfio-ap-drv: 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 matrix bus's match function that always returned 1 and so implements the same behaviour as when there is no match function

---
 drivers/s390/crypto/vfio_ap_drv.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/s390/crypto/vfio_ap_drv.c +0 -6
index 997b524bdd2b..9341c000da41 100644
@@ -59,14 +59,8 @@ static void vfio_ap_matrix_dev_release(struct device *dev)
 	kfree(matrix_dev);
 }
 
-static int matrix_bus_match(struct device *dev, struct device_driver *drv)
-{
-	return 1;
-}
-
 static struct bus_type matrix_bus = {
 	.name = "matrix",
-	.match = &matrix_bus_match,
 };
 
 static struct device_driver matrix_driver = {
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 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 matrix bus's match function that always returned 1 and so implements the same behaviour as when there is no match function

---
  drivers/s390/crypto/vfio_ap_drv.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/s390/crypto/vfio_ap_drv.c +0 -6
index 997b524bdd2b..9341c000da41 100644
@@ -59,14 +59,8 @@ static void vfio_ap_matrix_dev_release(struct device *dev)
  	kfree(matrix_dev);
  }
 
-static int matrix_bus_match(struct device *dev, struct device_driver *drv)
-{
-	return 1;
-}
-
  static struct bus_type matrix_bus = {
  	.name = "matrix",
-	.match = &matrix_bus_match,
  };
 
  static struct device_driver matrix_driver = {
maintainer Applied
#2 lore raw
In reply to Lizhe
Quoted 10 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 matrix bus's match function that always returned 1 and so implements the same behaviour as when there is no match function

---
 drivers/s390/crypto/vfio_ap_drv.c | 6 ------
 1 file changed, 6 deletions(-)

Applied.