diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2006-12-08 09:54:26 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-12-08 09:54:26 -0500 |
commit | 2ec2298412e1ab4674b3780005058d4f0b8bd858 (patch) | |
tree | 7d48542e666636de17ac18e50ed33b4639be43fb /drivers/s390/cio/device.c | |
parent | 7674da77cb2d27ae6559c55151da171ceb02beb4 (diff) |
[S390] subchannel lock conversion.
Convert the subchannel lock to a pointer to a lock. Needed for the dynamic
subchannel mapping patch.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index e644fd6905ee..9a31239fe028 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -774,9 +774,9 @@ io_subchannel_register(struct work_struct *work) | |||
774 | printk (KERN_WARNING "%s: could not register %s\n", | 774 | printk (KERN_WARNING "%s: could not register %s\n", |
775 | __func__, cdev->dev.bus_id); | 775 | __func__, cdev->dev.bus_id); |
776 | put_device(&cdev->dev); | 776 | put_device(&cdev->dev); |
777 | spin_lock_irqsave(&sch->lock, flags); | 777 | spin_lock_irqsave(sch->lock, flags); |
778 | sch->dev.driver_data = NULL; | 778 | sch->dev.driver_data = NULL; |
779 | spin_unlock_irqrestore(&sch->lock, flags); | 779 | spin_unlock_irqrestore(sch->lock, flags); |
780 | kfree (cdev->private); | 780 | kfree (cdev->private); |
781 | kfree (cdev); | 781 | kfree (cdev); |
782 | put_device(&sch->dev); | 782 | put_device(&sch->dev); |
@@ -860,7 +860,7 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch) | |||
860 | 860 | ||
861 | sch->dev.driver_data = cdev; | 861 | sch->dev.driver_data = cdev; |
862 | sch->driver = &io_subchannel_driver; | 862 | sch->driver = &io_subchannel_driver; |
863 | cdev->ccwlock = &sch->lock; | 863 | cdev->ccwlock = sch->lock; |
864 | 864 | ||
865 | /* Init private data. */ | 865 | /* Init private data. */ |
866 | priv = cdev->private; | 866 | priv = cdev->private; |
@@ -880,9 +880,9 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch) | |||
880 | atomic_inc(&ccw_device_init_count); | 880 | atomic_inc(&ccw_device_init_count); |
881 | 881 | ||
882 | /* Start async. device sensing. */ | 882 | /* Start async. device sensing. */ |
883 | spin_lock_irq(&sch->lock); | 883 | spin_lock_irq(sch->lock); |
884 | rc = ccw_device_recognition(cdev); | 884 | rc = ccw_device_recognition(cdev); |
885 | spin_unlock_irq(&sch->lock); | 885 | spin_unlock_irq(sch->lock); |
886 | if (rc) { | 886 | if (rc) { |
887 | if (atomic_dec_and_test(&ccw_device_init_count)) | 887 | if (atomic_dec_and_test(&ccw_device_init_count)) |
888 | wake_up(&ccw_device_init_wq); | 888 | wake_up(&ccw_device_init_wq); |
@@ -924,9 +924,9 @@ io_subchannel_probe (struct subchannel *sch) | |||
924 | 924 | ||
925 | rc = io_subchannel_recog(cdev, sch); | 925 | rc = io_subchannel_recog(cdev, sch); |
926 | if (rc) { | 926 | if (rc) { |
927 | spin_lock_irqsave(&sch->lock, flags); | 927 | spin_lock_irqsave(sch->lock, flags); |
928 | sch->dev.driver_data = NULL; | 928 | sch->dev.driver_data = NULL; |
929 | spin_unlock_irqrestore(&sch->lock, flags); | 929 | spin_unlock_irqrestore(sch->lock, flags); |
930 | if (cdev->dev.release) | 930 | if (cdev->dev.release) |
931 | cdev->dev.release(&cdev->dev); | 931 | cdev->dev.release(&cdev->dev); |
932 | } | 932 | } |
@@ -1036,6 +1036,13 @@ static struct ccw_device console_cdev; | |||
1036 | static struct ccw_device_private console_private; | 1036 | static struct ccw_device_private console_private; |
1037 | static int console_cdev_in_use; | 1037 | static int console_cdev_in_use; |
1038 | 1038 | ||
1039 | static DEFINE_SPINLOCK(ccw_console_lock); | ||
1040 | |||
1041 | spinlock_t * cio_get_console_lock(void) | ||
1042 | { | ||
1043 | return &ccw_console_lock; | ||
1044 | } | ||
1045 | |||
1039 | static int | 1046 | static int |
1040 | ccw_device_console_enable (struct ccw_device *cdev, struct subchannel *sch) | 1047 | ccw_device_console_enable (struct ccw_device *cdev, struct subchannel *sch) |
1041 | { | 1048 | { |