Commit 85fb534e authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

[S390] css: move chsc_private to drv_data

Use the subchannels drv_data to access chsc_private
for chsc subchannels.

Note: Also set the drv_data prior to the cio_enable_subchannel
call, since we can receive an interrupt the moment we enable
the subchannel and the IRQ handler relies on this data.
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f92519e8
...@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL"); ...@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
static void chsc_subchannel_irq(struct subchannel *sch) static void chsc_subchannel_irq(struct subchannel *sch)
{ {
struct chsc_private *private = sch->private; struct chsc_private *private = dev_get_drvdata(&sch->dev);
struct chsc_request *request = private->request; struct chsc_request *request = private->request;
struct irb *irb = (struct irb *)&S390_lowcore.irb; struct irb *irb = (struct irb *)&S390_lowcore.irb;
...@@ -80,13 +80,14 @@ static int chsc_subchannel_probe(struct subchannel *sch) ...@@ -80,13 +80,14 @@ static int chsc_subchannel_probe(struct subchannel *sch)
private = kzalloc(sizeof(*private), GFP_KERNEL); private = kzalloc(sizeof(*private), GFP_KERNEL);
if (!private) if (!private)
return -ENOMEM; return -ENOMEM;
dev_set_drvdata(&sch->dev, private);
ret = cio_enable_subchannel(sch, (u32)(unsigned long)sch); ret = cio_enable_subchannel(sch, (u32)(unsigned long)sch);
if (ret) { if (ret) {
CHSC_MSG(0, "Failed to enable 0.%x.%04x: %d\n", CHSC_MSG(0, "Failed to enable 0.%x.%04x: %d\n",
sch->schid.ssid, sch->schid.sch_no, ret); sch->schid.ssid, sch->schid.sch_no, ret);
dev_set_drvdata(&sch->dev, NULL);
kfree(private); kfree(private);
} else { } else {
sch->private = private;
if (dev_get_uevent_suppress(&sch->dev)) { if (dev_get_uevent_suppress(&sch->dev)) {
dev_set_uevent_suppress(&sch->dev, 0); dev_set_uevent_suppress(&sch->dev, 0);
kobject_uevent(&sch->dev.kobj, KOBJ_ADD); kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
...@@ -100,8 +101,8 @@ static int chsc_subchannel_remove(struct subchannel *sch) ...@@ -100,8 +101,8 @@ static int chsc_subchannel_remove(struct subchannel *sch)
struct chsc_private *private; struct chsc_private *private;
cio_disable_subchannel(sch); cio_disable_subchannel(sch);
private = sch->private; private = dev_get_drvdata(&sch->dev);
sch->private = NULL; dev_set_drvdata(&sch->dev, NULL);
if (private->request) { if (private->request) {
complete(&private->request->completion); complete(&private->request->completion);
put_device(&sch->dev); put_device(&sch->dev);
...@@ -241,7 +242,7 @@ static int chsc_async(struct chsc_async_area *chsc_area, ...@@ -241,7 +242,7 @@ static int chsc_async(struct chsc_async_area *chsc_area,
chsc_area->header.key = PAGE_DEFAULT_KEY >> 4; chsc_area->header.key = PAGE_DEFAULT_KEY >> 4;
while ((sch = chsc_get_next_subchannel(sch))) { while ((sch = chsc_get_next_subchannel(sch))) {
spin_lock(sch->lock); spin_lock(sch->lock);
private = sch->private; private = dev_get_drvdata(&sch->dev);
if (private->request) { if (private->request) {
spin_unlock(sch->lock); spin_unlock(sch->lock);
ret = -EBUSY; ret = -EBUSY;
......
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