aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 228a6c314d84..64bd79ac25a7 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -138,6 +138,19 @@ static struct css_device_id io_subchannel_ids[] = {
138}; 138};
139MODULE_DEVICE_TABLE(css, io_subchannel_ids); 139MODULE_DEVICE_TABLE(css, io_subchannel_ids);
140 140
141static int io_subchannel_prepare(struct subchannel *sch)
142{
143 struct ccw_device *cdev;
144 /*
145 * Don't allow suspend while a ccw device registration
146 * is still outstanding.
147 */
148 cdev = sch_get_cdev(sch);
149 if (cdev && !device_is_registered(&cdev->dev))
150 return -EAGAIN;
151 return 0;
152}
153
141static struct css_driver io_subchannel_driver = { 154static struct css_driver io_subchannel_driver = {
142 .owner = THIS_MODULE, 155 .owner = THIS_MODULE,
143 .subchannel_type = io_subchannel_ids, 156 .subchannel_type = io_subchannel_ids,
@@ -148,6 +161,7 @@ static struct css_driver io_subchannel_driver = {
148 .probe = io_subchannel_probe, 161 .probe = io_subchannel_probe,
149 .remove = io_subchannel_remove, 162 .remove = io_subchannel_remove,
150 .shutdown = io_subchannel_shutdown, 163 .shutdown = io_subchannel_shutdown,
164 .prepare = io_subchannel_prepare,
151}; 165};
152 166
153struct workqueue_struct *ccw_device_work; 167struct workqueue_struct *ccw_device_work;