Commit 602b20f2 authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky

[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: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 084325d8
...@@ -132,7 +132,7 @@ static void terminate_internal_io(struct subchannel *sch) ...@@ -132,7 +132,7 @@ static void terminate_internal_io(struct subchannel *sch)
device_set_intretry(sch); device_set_intretry(sch);
/* Call handler. */ /* Call handler. */
if (sch->driver && sch->driver->termination) if (sch->driver && sch->driver->termination)
sch->driver->termination(&sch->dev); sch->driver->termination(sch);
} }
static int static int
...@@ -172,12 +172,12 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) ...@@ -172,12 +172,12 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
terminate_internal_io(sch); terminate_internal_io(sch);
/* Re-start path verification. */ /* Re-start path verification. */
if (sch->driver && sch->driver->verify) if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
} }
} else { } else {
/* trigger path verification. */ /* trigger path verification. */
if (sch->driver && sch->driver->verify) if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
else if (sch->lpm == mask) else if (sch->lpm == mask)
goto out_unreg; goto out_unreg;
} }
...@@ -279,7 +279,7 @@ __s390_process_res_acc(struct subchannel_id schid, void *data) ...@@ -279,7 +279,7 @@ __s390_process_res_acc(struct subchannel_id schid, void *data)
if (!old_lpm && sch->lpm) if (!old_lpm && sch->lpm)
device_trigger_reprobe(sch); device_trigger_reprobe(sch);
else if (sch->driver && sch->driver->verify) else if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
out: out:
spin_unlock_irq(sch->lock); spin_unlock_irq(sch->lock);
put_device(&sch->dev); put_device(&sch->dev);
...@@ -549,7 +549,7 @@ __chp_add(struct subchannel_id schid, void *data) ...@@ -549,7 +549,7 @@ __chp_add(struct subchannel_id schid, void *data)
| mask) & sch->opm; | mask) & sch->opm;
if (sch->driver && sch->driver->verify) if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
spin_unlock_irq(sch->lock); spin_unlock_irq(sch->lock);
put_device(&sch->dev); put_device(&sch->dev);
...@@ -589,7 +589,7 @@ static void __s390_subchannel_vary_chpid(struct subchannel *sch, ...@@ -589,7 +589,7 @@ static void __s390_subchannel_vary_chpid(struct subchannel *sch,
if (!old_lpm) if (!old_lpm)
device_trigger_reprobe(sch); device_trigger_reprobe(sch);
else if (sch->driver && sch->driver->verify) else if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
break; break;
} }
sch->opm &= ~mask; sch->opm &= ~mask;
...@@ -603,13 +603,13 @@ static void __s390_subchannel_vary_chpid(struct subchannel *sch, ...@@ -603,13 +603,13 @@ static void __s390_subchannel_vary_chpid(struct subchannel *sch,
terminate_internal_io(sch); terminate_internal_io(sch);
/* Re-start path verification. */ /* Re-start path verification. */
if (sch->driver && sch->driver->verify) if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
} }
} else if (!sch->lpm) { } else if (!sch->lpm) {
if (device_trigger_verify(sch) != 0) if (device_trigger_verify(sch) != 0)
css_schedule_eval(sch->schid); css_schedule_eval(sch->schid);
} else if (sch->driver && sch->driver->verify) } else if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(sch);
break; break;
} }
spin_unlock_irqrestore(sch->lock, flags); spin_unlock_irqrestore(sch->lock, flags);
......
...@@ -147,7 +147,7 @@ cio_tpi(void) ...@@ -147,7 +147,7 @@ cio_tpi(void)
spin_lock(sch->lock); spin_lock(sch->lock);
memcpy (&sch->schib.scsw, &irb->scsw, sizeof (struct scsw)); memcpy (&sch->schib.scsw, &irb->scsw, sizeof (struct scsw));
if (sch->driver && sch->driver->irq) if (sch->driver && sch->driver->irq)
sch->driver->irq(&sch->dev); sch->driver->irq(sch);
spin_unlock(sch->lock); spin_unlock(sch->lock);
irq_exit (); irq_exit ();
_local_bh_enable(); _local_bh_enable();
...@@ -680,7 +680,7 @@ do_IRQ (struct pt_regs *regs) ...@@ -680,7 +680,7 @@ do_IRQ (struct pt_regs *regs)
sizeof (irb->scsw)); sizeof (irb->scsw));
/* Call interrupt handler if there is one. */ /* Call interrupt handler if there is one. */
if (sch->driver && sch->driver->irq) if (sch->driver && sch->driver->irq)
sch->driver->irq(&sch->dev); sch->driver->irq(sch);
} }
if (sch) if (sch)
spin_unlock(sch->lock); spin_unlock(sch->lock);
......
...@@ -293,7 +293,7 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow) ...@@ -293,7 +293,7 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
action = UNREGISTER; action = UNREGISTER;
if (sch->driver && sch->driver->notify) { if (sch->driver && sch->driver->notify) {
spin_unlock_irqrestore(sch->lock, flags); spin_unlock_irqrestore(sch->lock, flags);
ret = sch->driver->notify(&sch->dev, event); ret = sch->driver->notify(sch, event);
spin_lock_irqsave(sch->lock, flags); spin_lock_irqsave(sch->lock, flags);
if (ret) if (ret)
action = NONE; action = NONE;
......
...@@ -125,10 +125,10 @@ struct subchannel; ...@@ -125,10 +125,10 @@ struct subchannel;
struct css_driver { struct css_driver {
unsigned int subchannel_type; unsigned int subchannel_type;
struct device_driver drv; struct device_driver drv;
void (*irq)(struct device *); void (*irq)(struct subchannel *);
int (*notify)(struct device *, int); int (*notify)(struct subchannel *, int);
void (*verify)(struct device *); void (*verify)(struct subchannel *);
void (*termination)(struct device *); void (*termination)(struct subchannel *);
int (*probe)(struct subchannel *); int (*probe)(struct subchannel *);
int (*remove)(struct subchannel *); int (*remove)(struct subchannel *);
void (*shutdown)(struct subchannel *); void (*shutdown)(struct subchannel *);
......
...@@ -115,11 +115,12 @@ static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env) ...@@ -115,11 +115,12 @@ static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env)
struct bus_type ccw_bus_type; struct bus_type ccw_bus_type;
static int io_subchannel_probe (struct subchannel *); static void io_subchannel_irq(struct subchannel *);
static int io_subchannel_remove (struct subchannel *); static int io_subchannel_probe(struct subchannel *);
static int io_subchannel_notify(struct device *, int); static int io_subchannel_remove(struct subchannel *);
static void io_subchannel_verify(struct device *); static int io_subchannel_notify(struct subchannel *, int);
static void io_subchannel_ioterm(struct device *); static void io_subchannel_verify(struct subchannel *);
static void io_subchannel_ioterm(struct subchannel *);
static void io_subchannel_shutdown(struct subchannel *); static void io_subchannel_shutdown(struct subchannel *);
static struct css_driver io_subchannel_driver = { static struct css_driver io_subchannel_driver = {
...@@ -1096,6 +1097,18 @@ static void ccw_device_move_to_sch(struct work_struct *work) ...@@ -1096,6 +1097,18 @@ static void ccw_device_move_to_sch(struct work_struct *work)
put_device(&cdev->dev); put_device(&cdev->dev);
} }
static void io_subchannel_irq(struct subchannel *sch)
{
struct ccw_device *cdev;
cdev = sch->dev.driver_data;
CIO_TRACE_EVENT(3, "IRQ");
CIO_TRACE_EVENT(3, sch->dev.bus_id);
if (cdev)
dev_fsm_event(cdev, DEV_EVENT_INTERRUPT);
}
static int static int
io_subchannel_probe (struct subchannel *sch) io_subchannel_probe (struct subchannel *sch)
{ {
...@@ -1183,12 +1196,11 @@ io_subchannel_remove (struct subchannel *sch) ...@@ -1183,12 +1196,11 @@ io_subchannel_remove (struct subchannel *sch)
return 0; return 0;
} }
static int static int io_subchannel_notify(struct subchannel *sch, int event)
io_subchannel_notify(struct device *dev, int event)
{ {
struct ccw_device *cdev; struct ccw_device *cdev;
cdev = dev->driver_data; cdev = sch->dev.driver_data;
if (!cdev) if (!cdev)
return 0; return 0;
if (!cdev->drv) if (!cdev->drv)
...@@ -1198,22 +1210,20 @@ io_subchannel_notify(struct device *dev, int event) ...@@ -1198,22 +1210,20 @@ io_subchannel_notify(struct device *dev, int event)
return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0;
} }
static void static void io_subchannel_verify(struct subchannel *sch)
io_subchannel_verify(struct device *dev)
{ {
struct ccw_device *cdev; struct ccw_device *cdev;
cdev = dev->driver_data; cdev = sch->dev.driver_data;
if (cdev) if (cdev)
dev_fsm_event(cdev, DEV_EVENT_VERIFY); dev_fsm_event(cdev, DEV_EVENT_VERIFY);
} }
static void static void io_subchannel_ioterm(struct subchannel *sch)
io_subchannel_ioterm(struct device *dev)
{ {
struct ccw_device *cdev; struct ccw_device *cdev;
cdev = dev->driver_data; cdev = sch->dev.driver_data;
if (!cdev) if (!cdev)
return; return;
/* Internal I/O will be retried by the interrupt handler. */ /* Internal I/O will be retried by the interrupt handler. */
......
...@@ -74,7 +74,6 @@ extern struct workqueue_struct *ccw_device_notify_work; ...@@ -74,7 +74,6 @@ extern struct workqueue_struct *ccw_device_notify_work;
extern wait_queue_head_t ccw_device_init_wq; extern wait_queue_head_t ccw_device_init_wq;
extern atomic_t ccw_device_init_count; extern atomic_t ccw_device_init_count;
void io_subchannel_irq (struct device *pdev);
void io_subchannel_recog_done(struct ccw_device *cdev); void io_subchannel_recog_done(struct ccw_device *cdev);
int ccw_device_cancel_halt_clear(struct ccw_device *); int ccw_device_cancel_halt_clear(struct ccw_device *);
......
...@@ -399,7 +399,7 @@ ccw_device_oper_notify(struct work_struct *work) ...@@ -399,7 +399,7 @@ ccw_device_oper_notify(struct work_struct *work)
sch = to_subchannel(cdev->dev.parent); sch = to_subchannel(cdev->dev.parent);
if (sch->driver && sch->driver->notify) { if (sch->driver && sch->driver->notify) {
spin_unlock_irqrestore(cdev->ccwlock, flags); spin_unlock_irqrestore(cdev->ccwlock, flags);
ret = sch->driver->notify(&sch->dev, CIO_OPER); ret = sch->driver->notify(sch, CIO_OPER);
spin_lock_irqsave(cdev->ccwlock, flags); spin_lock_irqsave(cdev->ccwlock, flags);
} else } else
ret = 0; ret = 0;
...@@ -1273,21 +1273,4 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = { ...@@ -1273,21 +1273,4 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
}, },
}; };
/*
* io_subchannel_irq is called for "real" interrupts or for status
* pending conditions on msch.
*/
void
io_subchannel_irq (struct device *pdev)
{
struct ccw_device *cdev;
cdev = to_subchannel(pdev)->dev.driver_data;
CIO_TRACE_EVENT (3, "IRQ");
CIO_TRACE_EVENT (3, pdev->bus_id);
if (cdev)
dev_fsm_event(cdev, DEV_EVENT_INTERRUPT);
}
EXPORT_SYMBOL_GPL(ccw_device_set_timeout); EXPORT_SYMBOL_GPL(ccw_device_set_timeout);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment