aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device_fsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/device_fsm.c')
-rw-r--r--drivers/s390/cio/device_fsm.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 4804d944fb4d..669e6a75f54f 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -32,9 +32,9 @@ device_is_online(struct subchannel *sch)
32{ 32{
33 struct ccw_device *cdev; 33 struct ccw_device *cdev;
34 34
35 if (!sch->dev.driver_data) 35 cdev = sch_get_cdev(sch);
36 if (!cdev)
36 return 0; 37 return 0;
37 cdev = sch->dev.driver_data;
38 return (cdev->private->state == DEV_STATE_ONLINE); 38 return (cdev->private->state == DEV_STATE_ONLINE);
39} 39}
40 40
@@ -43,9 +43,9 @@ device_is_disconnected(struct subchannel *sch)
43{ 43{
44 struct ccw_device *cdev; 44 struct ccw_device *cdev;
45 45
46 if (!sch->dev.driver_data) 46 cdev = sch_get_cdev(sch);
47 if (!cdev)
47 return 0; 48 return 0;
48 cdev = sch->dev.driver_data;
49 return (cdev->private->state == DEV_STATE_DISCONNECTED || 49 return (cdev->private->state == DEV_STATE_DISCONNECTED ||
50 cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID); 50 cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID);
51} 51}
@@ -55,9 +55,9 @@ device_set_disconnected(struct subchannel *sch)
55{ 55{
56 struct ccw_device *cdev; 56 struct ccw_device *cdev;
57 57
58 if (!sch->dev.driver_data) 58 cdev = sch_get_cdev(sch);
59 if (!cdev)
59 return; 60 return;
60 cdev = sch->dev.driver_data;
61 ccw_device_set_timeout(cdev, 0); 61 ccw_device_set_timeout(cdev, 0);
62 cdev->private->flags.fake_irb = 0; 62 cdev->private->flags.fake_irb = 0;
63 cdev->private->state = DEV_STATE_DISCONNECTED; 63 cdev->private->state = DEV_STATE_DISCONNECTED;
@@ -67,7 +67,7 @@ void device_set_intretry(struct subchannel *sch)
67{ 67{
68 struct ccw_device *cdev; 68 struct ccw_device *cdev;
69 69
70 cdev = sch->dev.driver_data; 70 cdev = sch_get_cdev(sch);
71 if (!cdev) 71 if (!cdev)
72 return; 72 return;
73 cdev->private->flags.intretry = 1; 73 cdev->private->flags.intretry = 1;
@@ -77,7 +77,7 @@ int device_trigger_verify(struct subchannel *sch)
77{ 77{
78 struct ccw_device *cdev; 78 struct ccw_device *cdev;
79 79
80 cdev = sch->dev.driver_data; 80 cdev = sch_get_cdev(sch);
81 if (!cdev || !cdev->online) 81 if (!cdev || !cdev->online)
82 return -EINVAL; 82 return -EINVAL;
83 dev_fsm_event(cdev, DEV_EVENT_VERIFY); 83 dev_fsm_event(cdev, DEV_EVENT_VERIFY);
@@ -175,9 +175,9 @@ device_kill_pending_timer(struct subchannel *sch)
175{ 175{
176 struct ccw_device *cdev; 176 struct ccw_device *cdev;
177 177
178 if (!sch->dev.driver_data) 178 cdev = sch_get_cdev(sch);
179 if (!cdev)
179 return; 180 return;
180 cdev = sch->dev.driver_data;
181 ccw_device_set_timeout(cdev, 0); 181 ccw_device_set_timeout(cdev, 0);
182} 182}
183 183
@@ -992,7 +992,7 @@ void device_kill_io(struct subchannel *sch)
992 int ret; 992 int ret;
993 struct ccw_device *cdev; 993 struct ccw_device *cdev;
994 994
995 cdev = sch->dev.driver_data; 995 cdev = sch_get_cdev(sch);
996 ret = ccw_device_cancel_halt_clear(cdev); 996 ret = ccw_device_cancel_halt_clear(cdev);
997 if (ret == -EBUSY) { 997 if (ret == -EBUSY) {
998 ccw_device_set_timeout(cdev, 3*HZ); 998 ccw_device_set_timeout(cdev, 3*HZ);
@@ -1062,9 +1062,9 @@ device_trigger_reprobe(struct subchannel *sch)
1062{ 1062{
1063 struct ccw_device *cdev; 1063 struct ccw_device *cdev;
1064 1064
1065 if (!sch->dev.driver_data) 1065 cdev = sch_get_cdev(sch);
1066 if (!cdev)
1066 return; 1067 return;
1067 cdev = sch->dev.driver_data;
1068 if (cdev->private->state != DEV_STATE_DISCONNECTED) 1068 if (cdev->private->state != DEV_STATE_DISCONNECTED)
1069 return; 1069 return;
1070 1070