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

Message ID 20230319041941.259830-1-sensor1010@163.com
State New
Headers
Series [v1] s390/vfio-ap-drv: Remove redundant driver match function |

Commit Message

Lizhe March 19, 2023, 4:19 a.m. UTC
  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

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

Comments

Anthony Krowiak March 20, 2023, 2:47 p.m. UTC | #1
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>

On 3/19/23 12:19 AM, Lizhe wrote:
> 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
>
> Signed-off-by: Lizhe <sensor1010@163.com>
> ---
>   drivers/s390/crypto/vfio_ap_drv.c | 6 ------
>   1 file changed, 6 deletions(-)
>
> diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
> index 997b524bdd2b..9341c000da41 100644
> --- a/drivers/s390/crypto/vfio_ap_drv.c
> +++ b/drivers/s390/crypto/vfio_ap_drv.c
> @@ -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 = {
  
Heiko Carstens March 21, 2023, 1:41 p.m. UTC | #2
On Sun, Mar 19, 2023 at 12:19:41PM +0800, Lizhe wrote:
> 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
> 
> Signed-off-by: Lizhe <sensor1010@163.com>
> ---
>  drivers/s390/crypto/vfio_ap_drv.c | 6 ------
>  1 file changed, 6 deletions(-)

Applied.
  

Patch

diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
index 997b524bdd2b..9341c000da41 100644
--- a/drivers/s390/crypto/vfio_ap_drv.c
+++ b/drivers/s390/crypto/vfio_ap_drv.c
@@ -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 = {