diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-01-26 08:10:39 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:10:57 -0500 |
commit | 602b20f2bf335d0d5fce11cb2ade22aa74e7ba25 (patch) | |
tree | 2fdbeca6df1c7c5f1dad9c8f70c128c42a2621d5 | |
parent | 084325d80418adf4d75b10a9ceff1348f2e09163 (diff) |
[S390] cio: css_driver: Use consistent parameters.
Make all callbacks in css_driver take a struct subchannel (and not
a struct device).
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/cio/chsc.c | 16 | ||||
-rw-r--r-- | drivers/s390/cio/cio.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/css.h | 8 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 38 | ||||
-rw-r--r-- | drivers/s390/cio/device.h | 1 | ||||
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 19 |
7 files changed, 40 insertions, 48 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 597c0c76a2ad..44a2ea40806e 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -132,7 +132,7 @@ static void terminate_internal_io(struct subchannel *sch) | |||
132 | device_set_intretry(sch); | 132 | device_set_intretry(sch); |
133 | /* Call handler. */ | 133 | /* Call handler. */ |
134 | if (sch->driver && sch->driver->termination) | 134 | if (sch->driver && sch->driver->termination) |
135 | sch->driver->termination(&sch->dev); | 135 | sch->driver->termination(sch); |
136 | } | 136 | } |
137 | 137 | ||
138 | static int | 138 | static int |
@@ -172,12 +172,12 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) | |||
172 | terminate_internal_io(sch); | 172 | terminate_internal_io(sch); |
173 | /* Re-start path verification. */ | 173 | /* Re-start path verification. */ |
174 | if (sch->driver && sch->driver->verify) | 174 | if (sch->driver && sch->driver->verify) |
175 | sch->driver->verify(&sch->dev); | 175 | sch->driver->verify(sch); |
176 | } | 176 | } |
177 | } else { | 177 | } else { |
178 | /* trigger path verification. */ | 178 | /* trigger path verification. */ |
179 | if (sch->driver && sch->driver->verify) | 179 | if (sch->driver && sch->driver->verify) |
180 | sch->driver->verify(&sch->dev); | 180 | sch->driver->verify(sch); |
181 | else if (sch->lpm == mask) | 181 | else if (sch->lpm == mask) |
182 | goto out_unreg; | 182 | goto out_unreg; |
183 | } | 183 | } |
@@ -279,7 +279,7 @@ __s390_process_res_acc(struct subchannel_id schid, void *data) | |||
279 | if (!old_lpm && sch->lpm) | 279 | if (!old_lpm && sch->lpm) |
280 | device_trigger_reprobe(sch); | 280 | device_trigger_reprobe(sch); |
281 | else if (sch->driver && sch->driver->verify) | 281 | else if (sch->driver && sch->driver->verify) |
282 | sch->driver->verify(&sch->dev); | 282 | sch->driver->verify(sch); |
283 | out: | 283 | out: |
284 | spin_unlock_irq(sch->lock); | 284 | spin_unlock_irq(sch->lock); |
285 | put_device(&sch->dev); | 285 | put_device(&sch->dev); |
@@ -549,7 +549,7 @@ __chp_add(struct subchannel_id schid, void *data) | |||
549 | | mask) & sch->opm; | 549 | | mask) & sch->opm; |
550 | 550 | ||
551 | if (sch->driver && sch->driver->verify) | 551 | if (sch->driver && sch->driver->verify) |
552 | sch->driver->verify(&sch->dev); | 552 | sch->driver->verify(sch); |
553 | 553 | ||
554 | spin_unlock_irq(sch->lock); | 554 | spin_unlock_irq(sch->lock); |
555 | put_device(&sch->dev); | 555 | put_device(&sch->dev); |
@@ -589,7 +589,7 @@ static void __s390_subchannel_vary_chpid(struct subchannel *sch, | |||
589 | if (!old_lpm) | 589 | if (!old_lpm) |
590 | device_trigger_reprobe(sch); | 590 | device_trigger_reprobe(sch); |
591 | else if (sch->driver && sch->driver->verify) | 591 | else if (sch->driver && sch->driver->verify) |
592 | sch->driver->verify(&sch->dev); | 592 | sch->driver->verify(sch); |
593 | break; | 593 | break; |
594 | } | 594 | } |
595 | sch->opm &= ~mask; | 595 | sch->opm &= ~mask; |
@@ -603,13 +603,13 @@ static void __s390_subchannel_vary_chpid(struct subchannel *sch, | |||
603 | terminate_internal_io(sch); | 603 | terminate_internal_io(sch); |
604 | /* Re-start path verification. */ | 604 | /* Re-start path verification. */ |
605 | if (sch->driver && sch->driver->verify) | 605 | if (sch->driver && sch->driver->verify) |
606 | sch->driver->verify(&sch->dev); | 606 | sch->driver->verify(sch); |
607 | } | 607 | } |
608 | } else if (!sch->lpm) { | 608 | } else if (!sch->lpm) { |
609 | if (device_trigger_verify(sch) != 0) | 609 | if (device_trigger_verify(sch) != 0) |
610 | css_schedule_eval(sch->schid); | 610 | css_schedule_eval(sch->schid); |
611 | } else if (sch->driver && sch->driver->verify) | 611 | } else if (sch->driver && sch->driver->verify) |
612 | sch->driver->verify(&sch->dev); | 612 | sch->driver->verify(sch); |
613 | break; | 613 | break; |
614 | } | 614 | } |
615 | spin_unlock_irqrestore(sch->lock, flags); | 615 | spin_unlock_irqrestore(sch->lock, flags); |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 46905345159e..469b00774c5e 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -147,7 +147,7 @@ cio_tpi(void) | |||
147 | spin_lock(sch->lock); | 147 | spin_lock(sch->lock); |
148 | memcpy (&sch->schib.scsw, &irb->scsw, sizeof (struct scsw)); | 148 | memcpy (&sch->schib.scsw, &irb->scsw, sizeof (struct scsw)); |
149 | if (sch->driver && sch->driver->irq) | 149 | if (sch->driver && sch->driver->irq) |
150 | sch->driver->irq(&sch->dev); | 150 | sch->driver->irq(sch); |
151 | spin_unlock(sch->lock); | 151 | spin_unlock(sch->lock); |
152 | irq_exit (); | 152 | irq_exit (); |
153 | _local_bh_enable(); | 153 | _local_bh_enable(); |
@@ -680,7 +680,7 @@ do_IRQ (struct pt_regs *regs) | |||
680 | sizeof (irb->scsw)); | 680 | sizeof (irb->scsw)); |
681 | /* Call interrupt handler if there is one. */ | 681 | /* Call interrupt handler if there is one. */ |
682 | if (sch->driver && sch->driver->irq) | 682 | if (sch->driver && sch->driver->irq) |
683 | sch->driver->irq(&sch->dev); | 683 | sch->driver->irq(sch); |
684 | } | 684 | } |
685 | if (sch) | 685 | if (sch) |
686 | spin_unlock(sch->lock); | 686 | spin_unlock(sch->lock); |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index bc2f8fa576a3..614cc694184e 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -293,7 +293,7 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow) | |||
293 | action = UNREGISTER; | 293 | action = UNREGISTER; |
294 | if (sch->driver && sch->driver->notify) { | 294 | if (sch->driver && sch->driver->notify) { |
295 | spin_unlock_irqrestore(sch->lock, flags); | 295 | spin_unlock_irqrestore(sch->lock, flags); |
296 | ret = sch->driver->notify(&sch->dev, event); | 296 | ret = sch->driver->notify(sch, event); |
297 | spin_lock_irqsave(sch->lock, flags); | 297 | spin_lock_irqsave(sch->lock, flags); |
298 | if (ret) | 298 | if (ret) |
299 | action = NONE; | 299 | action = NONE; |
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index 1d8306cc74c4..32acd24a407c 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h | |||
@@ -125,10 +125,10 @@ struct subchannel; | |||
125 | struct css_driver { | 125 | struct css_driver { |
126 | unsigned int subchannel_type; | 126 | unsigned int subchannel_type; |
127 | struct device_driver drv; | 127 | struct device_driver drv; |
128 | void (*irq)(struct device *); | 128 | void (*irq)(struct subchannel *); |
129 | int (*notify)(struct device *, int); | 129 | int (*notify)(struct subchannel *, int); |
130 | void (*verify)(struct device *); | 130 | void (*verify)(struct subchannel *); |
131 | void (*termination)(struct device *); | 131 | void (*termination)(struct subchannel *); |
132 | int (*probe)(struct subchannel *); | 132 | int (*probe)(struct subchannel *); |
133 | int (*remove)(struct subchannel *); | 133 | int (*remove)(struct subchannel *); |
134 | void (*shutdown)(struct subchannel *); | 134 | void (*shutdown)(struct subchannel *); |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 74f6b539974a..000c64129ed8 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -115,11 +115,12 @@ static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
115 | 115 | ||
116 | struct bus_type ccw_bus_type; | 116 | struct bus_type ccw_bus_type; |
117 | 117 | ||
118 | static int io_subchannel_probe (struct subchannel *); | 118 | static void io_subchannel_irq(struct subchannel *); |
119 | static int io_subchannel_remove (struct subchannel *); | 119 | static int io_subchannel_probe(struct subchannel *); |
120 | static int io_subchannel_notify(struct device *, int); | 120 | static int io_subchannel_remove(struct subchannel *); |
121 | static void io_subchannel_verify(struct device *); | 121 | static int io_subchannel_notify(struct subchannel *, int); |
122 | static void io_subchannel_ioterm(struct device *); | 122 | static void io_subchannel_verify(struct subchannel *); |
123 | static void io_subchannel_ioterm(struct subchannel *); | ||
123 | static void io_subchannel_shutdown(struct subchannel *); | 124 | static void io_subchannel_shutdown(struct subchannel *); |
124 | 125 | ||
125 | static struct css_driver io_subchannel_driver = { | 126 | static struct css_driver io_subchannel_driver = { |
@@ -1096,6 +1097,18 @@ out: | |||
1096 | put_device(&cdev->dev); | 1097 | put_device(&cdev->dev); |
1097 | } | 1098 | } |
1098 | 1099 | ||
1100 | static void io_subchannel_irq(struct subchannel *sch) | ||
1101 | { | ||
1102 | struct ccw_device *cdev; | ||
1103 | |||
1104 | cdev = sch->dev.driver_data; | ||
1105 | |||
1106 | CIO_TRACE_EVENT(3, "IRQ"); | ||
1107 | CIO_TRACE_EVENT(3, sch->dev.bus_id); | ||
1108 | if (cdev) | ||
1109 | dev_fsm_event(cdev, DEV_EVENT_INTERRUPT); | ||
1110 | } | ||
1111 | |||
1099 | static int | 1112 | static int |
1100 | io_subchannel_probe (struct subchannel *sch) | 1113 | io_subchannel_probe (struct subchannel *sch) |
1101 | { | 1114 | { |
@@ -1183,12 +1196,11 @@ io_subchannel_remove (struct subchannel *sch) | |||
1183 | return 0; | 1196 | return 0; |
1184 | } | 1197 | } |
1185 | 1198 | ||
1186 | static int | 1199 | static int io_subchannel_notify(struct subchannel *sch, int event) |
1187 | io_subchannel_notify(struct device *dev, int event) | ||
1188 | { | 1200 | { |
1189 | struct ccw_device *cdev; | 1201 | struct ccw_device *cdev; |
1190 | 1202 | ||
1191 | cdev = dev->driver_data; | 1203 | cdev = sch->dev.driver_data; |
1192 | if (!cdev) | 1204 | if (!cdev) |
1193 | return 0; | 1205 | return 0; |
1194 | if (!cdev->drv) | 1206 | if (!cdev->drv) |
@@ -1198,22 +1210,20 @@ io_subchannel_notify(struct device *dev, int event) | |||
1198 | return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; | 1210 | return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; |
1199 | } | 1211 | } |
1200 | 1212 | ||
1201 | static void | 1213 | static void io_subchannel_verify(struct subchannel *sch) |
1202 | io_subchannel_verify(struct device *dev) | ||
1203 | { | 1214 | { |
1204 | struct ccw_device *cdev; | 1215 | struct ccw_device *cdev; |
1205 | 1216 | ||
1206 | cdev = dev->driver_data; | 1217 | cdev = sch->dev.driver_data; |
1207 | if (cdev) | 1218 | if (cdev) |
1208 | dev_fsm_event(cdev, DEV_EVENT_VERIFY); | 1219 | dev_fsm_event(cdev, DEV_EVENT_VERIFY); |
1209 | } | 1220 | } |
1210 | 1221 | ||
1211 | static void | 1222 | static void io_subchannel_ioterm(struct subchannel *sch) |
1212 | io_subchannel_ioterm(struct device *dev) | ||
1213 | { | 1223 | { |
1214 | struct ccw_device *cdev; | 1224 | struct ccw_device *cdev; |
1215 | 1225 | ||
1216 | cdev = dev->driver_data; | 1226 | cdev = sch->dev.driver_data; |
1217 | if (!cdev) | 1227 | if (!cdev) |
1218 | return; | 1228 | return; |
1219 | /* Internal I/O will be retried by the interrupt handler. */ | 1229 | /* Internal I/O will be retried by the interrupt handler. */ |
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index 0d4089600439..6183731fb9a2 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h | |||
@@ -74,7 +74,6 @@ extern struct workqueue_struct *ccw_device_notify_work; | |||
74 | extern wait_queue_head_t ccw_device_init_wq; | 74 | extern wait_queue_head_t ccw_device_init_wq; |
75 | extern atomic_t ccw_device_init_count; | 75 | extern atomic_t ccw_device_init_count; |
76 | 76 | ||
77 | void io_subchannel_irq (struct device *pdev); | ||
78 | void io_subchannel_recog_done(struct ccw_device *cdev); | 77 | void io_subchannel_recog_done(struct ccw_device *cdev); |
79 | 78 | ||
80 | int ccw_device_cancel_halt_clear(struct ccw_device *); | 79 | int ccw_device_cancel_halt_clear(struct ccw_device *); |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 31c0f7885161..baca6c6c9855 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -399,7 +399,7 @@ ccw_device_oper_notify(struct work_struct *work) | |||
399 | sch = to_subchannel(cdev->dev.parent); | 399 | sch = to_subchannel(cdev->dev.parent); |
400 | if (sch->driver && sch->driver->notify) { | 400 | if (sch->driver && sch->driver->notify) { |
401 | spin_unlock_irqrestore(cdev->ccwlock, flags); | 401 | spin_unlock_irqrestore(cdev->ccwlock, flags); |
402 | ret = sch->driver->notify(&sch->dev, CIO_OPER); | 402 | ret = sch->driver->notify(sch, CIO_OPER); |
403 | spin_lock_irqsave(cdev->ccwlock, flags); | 403 | spin_lock_irqsave(cdev->ccwlock, flags); |
404 | } else | 404 | } else |
405 | ret = 0; | 405 | ret = 0; |
@@ -1273,21 +1273,4 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = { | |||
1273 | }, | 1273 | }, |
1274 | }; | 1274 | }; |
1275 | 1275 | ||
1276 | /* | ||
1277 | * io_subchannel_irq is called for "real" interrupts or for status | ||
1278 | * pending conditions on msch. | ||
1279 | */ | ||
1280 | void | ||
1281 | io_subchannel_irq (struct device *pdev) | ||
1282 | { | ||
1283 | struct ccw_device *cdev; | ||
1284 | |||
1285 | cdev = to_subchannel(pdev)->dev.driver_data; | ||
1286 | |||
1287 | CIO_TRACE_EVENT (3, "IRQ"); | ||
1288 | CIO_TRACE_EVENT (3, pdev->bus_id); | ||
1289 | if (cdev) | ||
1290 | dev_fsm_event(cdev, DEV_EVENT_INTERRUPT); | ||
1291 | } | ||
1292 | |||
1293 | EXPORT_SYMBOL_GPL(ccw_device_set_timeout); | 1276 | EXPORT_SYMBOL_GPL(ccw_device_set_timeout); |