aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/ccwgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/ccwgroup.c')
-rw-r--r--drivers/s390/cio/ccwgroup.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index ec2742813bf2..2becedbe8883 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -454,13 +454,17 @@ ccwgroup_remove (struct device *dev)
454 struct ccwgroup_device *gdev; 454 struct ccwgroup_device *gdev;
455 struct ccwgroup_driver *gdrv; 455 struct ccwgroup_driver *gdrv;
456 456
457 device_remove_file(dev, &dev_attr_online);
458
459 if (!dev->driver)
460 return 0;
461
457 gdev = to_ccwgroupdev(dev); 462 gdev = to_ccwgroupdev(dev);
458 gdrv = to_ccwgroupdrv(dev->driver); 463 gdrv = to_ccwgroupdrv(dev->driver);
459 464
460 device_remove_file(dev, &dev_attr_online); 465 if (gdrv->remove)
461
462 if (gdrv && gdrv->remove)
463 gdrv->remove(gdev); 466 gdrv->remove(gdev);
467
464 return 0; 468 return 0;
465} 469}
466 470
@@ -469,9 +473,13 @@ static void ccwgroup_shutdown(struct device *dev)
469 struct ccwgroup_device *gdev; 473 struct ccwgroup_device *gdev;
470 struct ccwgroup_driver *gdrv; 474 struct ccwgroup_driver *gdrv;
471 475
476 if (!dev->driver)
477 return;
478
472 gdev = to_ccwgroupdev(dev); 479 gdev = to_ccwgroupdev(dev);
473 gdrv = to_ccwgroupdrv(dev->driver); 480 gdrv = to_ccwgroupdrv(dev->driver);
474 if (gdrv && gdrv->shutdown) 481
482 if (gdrv->shutdown)
475 gdrv->shutdown(gdev); 483 gdrv->shutdown(gdev);
476} 484}
477 485