vfio/ccw: Flatten MDEV device (un)register
authorEric Farman <farman@linux.ibm.com>
Thu, 7 Jul 2022 13:57:32 +0000 (15:57 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 7 Jul 2022 20:06:12 +0000 (14:06 -0600)
The vfio_ccw_mdev_(un)reg routines are merely vfio-ccw routines that
pass control to mdev_(un)register_device. Since there's only one
caller of each, let's just call the mdev routines directly.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20220707135737.720765-7-farman@linux.ibm.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/s390/cio/vfio_ccw_drv.c
drivers/s390/cio/vfio_ccw_ops.c
drivers/s390/cio/vfio_ccw_private.h

index 279ad2161f179a4d9351c880927d3ab5e65d71c2..fe87a2652a2225f1ea649686ddac4ccc9417e75f 100644 (file)
@@ -240,7 +240,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
 
        private->state = VFIO_CCW_STATE_STANDBY;
 
-       ret = vfio_ccw_mdev_reg(sch);
+       ret = mdev_register_device(&sch->dev, &vfio_ccw_mdev_driver);
        if (ret)
                goto out_disable;
 
@@ -262,7 +262,7 @@ static void vfio_ccw_sch_remove(struct subchannel *sch)
        struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
 
        vfio_ccw_sch_quiesce(sch);
-       vfio_ccw_mdev_unreg(sch);
+       mdev_unregister_device(&sch->dev);
 
        dev_set_drvdata(&sch->dev, NULL);
 
index 81377270d4a74dee8b86fd5623bf1784eb429cf3..a7ea9358e461c54c906b7b87ce7818c7b924560b 100644 (file)
@@ -654,13 +654,3 @@ struct mdev_driver vfio_ccw_mdev_driver = {
        .remove = vfio_ccw_mdev_remove,
        .supported_type_groups  = mdev_type_groups,
 };
-
-int vfio_ccw_mdev_reg(struct subchannel *sch)
-{
-       return mdev_register_device(&sch->dev, &vfio_ccw_mdev_driver);
-}
-
-void vfio_ccw_mdev_unreg(struct subchannel *sch)
-{
-       mdev_unregister_device(&sch->dev);
-}
index 5891bea8ce41566467495762a03f8d70b6b034b4..a2584c130e79d21693c9b3943244668d32905ff4 100644 (file)
@@ -117,9 +117,6 @@ struct vfio_ccw_private {
        struct work_struct      crw_work;
 } __aligned(8);
 
-int vfio_ccw_mdev_reg(struct subchannel *sch);
-void vfio_ccw_mdev_unreg(struct subchannel *sch);
-
 int vfio_ccw_sch_quiesce(struct subchannel *sch);
 
 extern struct mdev_driver vfio_ccw_mdev_driver;