aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-01-26 08:10:46 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-01-26 08:11:02 -0500
commitdb6a64238a927777e6e7b251927313f186455b1c (patch)
tree1c87902e01b7e0a67b81eb641392cd83717a8970 /drivers/s390/cio/device.c
parentb279a4f56d5476a0b9b0a97397f7a7bbe00b9b2f (diff)
[S390] cio: Use dev_{g,s}et_drvdata().
Also define helpers sch_{g,s}et_cdev() to make the intention more clear. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 30fe59cc28c9..933f763e9586 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -773,7 +773,7 @@ static void sch_attach_device(struct subchannel *sch,
773{ 773{
774 css_update_ssd_info(sch); 774 css_update_ssd_info(sch);
775 spin_lock_irq(sch->lock); 775 spin_lock_irq(sch->lock);
776 sch->dev.driver_data = cdev; 776 sch_set_cdev(sch, cdev);
777 cdev->private->schid = sch->schid; 777 cdev->private->schid = sch->schid;
778 cdev->ccwlock = sch->lock; 778 cdev->ccwlock = sch->lock;
779 device_trigger_reprobe(sch); 779 device_trigger_reprobe(sch);
@@ -795,7 +795,7 @@ static void sch_attach_disconnected_device(struct subchannel *sch,
795 put_device(&other_sch->dev); 795 put_device(&other_sch->dev);
796 return; 796 return;
797 } 797 }
798 other_sch->dev.driver_data = NULL; 798 sch_set_cdev(other_sch, NULL);
799 /* No need to keep a subchannel without ccw device around. */ 799 /* No need to keep a subchannel without ccw device around. */
800 css_sch_device_unregister(other_sch); 800 css_sch_device_unregister(other_sch);
801 put_device(&other_sch->dev); 801 put_device(&other_sch->dev);
@@ -831,12 +831,12 @@ static void sch_create_and_recog_new_device(struct subchannel *sch)
831 return; 831 return;
832 } 832 }
833 spin_lock_irq(sch->lock); 833 spin_lock_irq(sch->lock);
834 sch->dev.driver_data = cdev; 834 sch_set_cdev(sch, cdev);
835 spin_unlock_irq(sch->lock); 835 spin_unlock_irq(sch->lock);
836 /* Start recognition for the new ccw device. */ 836 /* Start recognition for the new ccw device. */
837 if (io_subchannel_recog(cdev, sch)) { 837 if (io_subchannel_recog(cdev, sch)) {
838 spin_lock_irq(sch->lock); 838 spin_lock_irq(sch->lock);
839 sch->dev.driver_data = NULL; 839 sch_set_cdev(sch, NULL);
840 spin_unlock_irq(sch->lock); 840 spin_unlock_irq(sch->lock);
841 if (cdev->dev.release) 841 if (cdev->dev.release)
842 cdev->dev.release(&cdev->dev); 842 cdev->dev.release(&cdev->dev);
@@ -940,7 +940,7 @@ io_subchannel_register(struct work_struct *work)
940 cdev->private->dev_id.devno, ret); 940 cdev->private->dev_id.devno, ret);
941 put_device(&cdev->dev); 941 put_device(&cdev->dev);
942 spin_lock_irqsave(sch->lock, flags); 942 spin_lock_irqsave(sch->lock, flags);
943 sch->dev.driver_data = NULL; 943 sch_set_cdev(sch, NULL);
944 spin_unlock_irqrestore(sch->lock, flags); 944 spin_unlock_irqrestore(sch->lock, flags);
945 kfree (cdev->private); 945 kfree (cdev->private);
946 kfree (cdev); 946 kfree (cdev);
@@ -1022,7 +1022,7 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch)
1022 int rc; 1022 int rc;
1023 struct ccw_device_private *priv; 1023 struct ccw_device_private *priv;
1024 1024
1025 sch->dev.driver_data = cdev; 1025 sch_set_cdev(sch, cdev);
1026 sch->driver = &io_subchannel_driver; 1026 sch->driver = &io_subchannel_driver;
1027 cdev->ccwlock = sch->lock; 1027 cdev->ccwlock = sch->lock;
1028 1028
@@ -1082,7 +1082,7 @@ static void ccw_device_move_to_sch(struct work_struct *work)
1082 } 1082 }
1083 if (former_parent) { 1083 if (former_parent) {
1084 spin_lock_irq(former_parent->lock); 1084 spin_lock_irq(former_parent->lock);
1085 former_parent->dev.driver_data = NULL; 1085 sch_set_cdev(former_parent, NULL);
1086 spin_unlock_irq(former_parent->lock); 1086 spin_unlock_irq(former_parent->lock);
1087 css_sch_device_unregister(former_parent); 1087 css_sch_device_unregister(former_parent);
1088 /* Reset intparm to zeroes. */ 1088 /* Reset intparm to zeroes. */
@@ -1100,7 +1100,7 @@ static void io_subchannel_irq(struct subchannel *sch)
1100{ 1100{
1101 struct ccw_device *cdev; 1101 struct ccw_device *cdev;
1102 1102
1103 cdev = sch->dev.driver_data; 1103 cdev = sch_get_cdev(sch);
1104 1104
1105 CIO_TRACE_EVENT(3, "IRQ"); 1105 CIO_TRACE_EVENT(3, "IRQ");
1106 CIO_TRACE_EVENT(3, sch->dev.bus_id); 1106 CIO_TRACE_EVENT(3, sch->dev.bus_id);
@@ -1116,13 +1116,13 @@ io_subchannel_probe (struct subchannel *sch)
1116 unsigned long flags; 1116 unsigned long flags;
1117 struct ccw_dev_id dev_id; 1117 struct ccw_dev_id dev_id;
1118 1118
1119 if (sch->dev.driver_data) { 1119 cdev = sch_get_cdev(sch);
1120 if (cdev) {
1120 /* 1121 /*
1121 * This subchannel already has an associated ccw_device. 1122 * This subchannel already has an associated ccw_device.
1122 * Register it and exit. This happens for all early 1123 * Register it and exit. This happens for all early
1123 * device, e.g. the console. 1124 * device, e.g. the console.
1124 */ 1125 */
1125 cdev = sch->dev.driver_data;
1126 cdev->dev.groups = ccwdev_attr_groups; 1126 cdev->dev.groups = ccwdev_attr_groups;
1127 device_initialize(&cdev->dev); 1127 device_initialize(&cdev->dev);
1128 ccw_device_register(cdev); 1128 ccw_device_register(cdev);
@@ -1173,7 +1173,7 @@ io_subchannel_probe (struct subchannel *sch)
1173 rc = io_subchannel_recog(cdev, sch); 1173 rc = io_subchannel_recog(cdev, sch);
1174 if (rc) { 1174 if (rc) {
1175 spin_lock_irqsave(sch->lock, flags); 1175 spin_lock_irqsave(sch->lock, flags);
1176 sch->dev.driver_data = NULL; 1176 sch_set_cdev(sch, NULL);
1177 spin_unlock_irqrestore(sch->lock, flags); 1177 spin_unlock_irqrestore(sch->lock, flags);
1178 if (cdev->dev.release) 1178 if (cdev->dev.release)
1179 cdev->dev.release(&cdev->dev); 1179 cdev->dev.release(&cdev->dev);
@@ -1189,12 +1189,12 @@ io_subchannel_remove (struct subchannel *sch)
1189 struct ccw_device *cdev; 1189 struct ccw_device *cdev;
1190 unsigned long flags; 1190 unsigned long flags;
1191 1191
1192 if (!sch->dev.driver_data) 1192 cdev = sch_get_cdev(sch);
1193 if (!cdev)
1193 return 0; 1194 return 0;
1194 cdev = sch->dev.driver_data;
1195 /* Set ccw device to not operational and drop reference. */ 1195 /* Set ccw device to not operational and drop reference. */
1196 spin_lock_irqsave(cdev->ccwlock, flags); 1196 spin_lock_irqsave(cdev->ccwlock, flags);
1197 sch->dev.driver_data = NULL; 1197 sch_set_cdev(sch, NULL);
1198 cdev->private->state = DEV_STATE_NOT_OPER; 1198 cdev->private->state = DEV_STATE_NOT_OPER;
1199 spin_unlock_irqrestore(cdev->ccwlock, flags); 1199 spin_unlock_irqrestore(cdev->ccwlock, flags);
1200 ccw_device_unregister(cdev); 1200 ccw_device_unregister(cdev);
@@ -1207,7 +1207,7 @@ static int io_subchannel_notify(struct subchannel *sch, int event)
1207{ 1207{
1208 struct ccw_device *cdev; 1208 struct ccw_device *cdev;
1209 1209
1210 cdev = sch->dev.driver_data; 1210 cdev = sch_get_cdev(sch);
1211 if (!cdev) 1211 if (!cdev)
1212 return 0; 1212 return 0;
1213 if (!cdev->drv) 1213 if (!cdev->drv)
@@ -1221,7 +1221,7 @@ static void io_subchannel_verify(struct subchannel *sch)
1221{ 1221{
1222 struct ccw_device *cdev; 1222 struct ccw_device *cdev;
1223 1223
1224 cdev = sch->dev.driver_data; 1224 cdev = sch_get_cdev(sch);
1225 if (cdev) 1225 if (cdev)
1226 dev_fsm_event(cdev, DEV_EVENT_VERIFY); 1226 dev_fsm_event(cdev, DEV_EVENT_VERIFY);
1227} 1227}
@@ -1230,7 +1230,7 @@ static void io_subchannel_ioterm(struct subchannel *sch)
1230{ 1230{
1231 struct ccw_device *cdev; 1231 struct ccw_device *cdev;
1232 1232
1233 cdev = sch->dev.driver_data; 1233 cdev = sch_get_cdev(sch);
1234 if (!cdev) 1234 if (!cdev)
1235 return; 1235 return;
1236 /* Internal I/O will be retried by the interrupt handler. */ 1236 /* Internal I/O will be retried by the interrupt handler. */
@@ -1248,7 +1248,7 @@ io_subchannel_shutdown(struct subchannel *sch)
1248 struct ccw_device *cdev; 1248 struct ccw_device *cdev;
1249 int ret; 1249 int ret;
1250 1250
1251 cdev = sch->dev.driver_data; 1251 cdev = sch_get_cdev(sch);
1252 1252
1253 if (cio_is_console(sch->schid)) 1253 if (cio_is_console(sch->schid))
1254 return; 1254 return;