s390/ccwgroup: use ccwgroup_ungroup wrapper
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Fri, 13 Jun 2014 16:11:37 +0000 (18:11 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 16 Jun 2014 08:32:52 +0000 (10:32 +0200)
To ungroup and deregister the group device always use the
ccwgroup_ungroup wrapper.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/ccwgroup.c

index 4ec19870447ef00207c3708ed44b5e69e671cb8a..e443b0d0b23612efec3800a5468e36e58ef7f8d3 100644 (file)
@@ -586,11 +586,7 @@ void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver)
                                         __ccwgroup_match_all))) {
                struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
 
-               mutex_lock(&gdev->reg_mutex);
-               __ccwgroup_remove_symlinks(gdev);
-               device_unregister(dev);
-               __ccwgroup_remove_cdev_refs(gdev);
-               mutex_unlock(&gdev->reg_mutex);
+               ccwgroup_ungroup(gdev);
                put_device(dev);
        }
        driver_unregister(&cdriver->driver);
@@ -637,13 +633,7 @@ void ccwgroup_remove_ccwdev(struct ccw_device *cdev)
        get_device(&gdev->dev);
        spin_unlock_irq(cdev->ccwlock);
        /* Unregister group device. */
-       mutex_lock(&gdev->reg_mutex);
-       if (device_is_registered(&gdev->dev)) {
-               __ccwgroup_remove_symlinks(gdev);
-               device_unregister(&gdev->dev);
-               __ccwgroup_remove_cdev_refs(gdev);
-       }
-       mutex_unlock(&gdev->reg_mutex);
+       ccwgroup_ungroup(gdev);
        /* Release ccwgroup device reference for local processing. */
        put_device(&gdev->dev);
 }