aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/con3215.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-05-04 15:40:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:30:28 -0400
commitdff59b64af94dc588044d70f3708cb835055c5b6 (patch)
tree5d4069fa0ac280b637b8aa691e71ac3b58a508b5 /drivers/s390/char/con3215.c
parent61616115d748e2eb76c43715383e602b09d9bf50 (diff)
s390: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Thanks to Sebastian Ott <sebott@linux.vnet.ibm.com> for fixing a few typos in my original version of this patch. Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Cc: linux-s390@vger.kernel.org Cc: linux390@de.ibm.com Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/s390/char/con3215.c')
-rw-r--r--drivers/s390/char/con3215.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 9ab06e0dad40..c639361d8085 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -368,7 +368,7 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
368 int cstat, dstat; 368 int cstat, dstat;
369 int count; 369 int count;
370 370
371 raw = cdev->dev.driver_data; 371 raw = dev_get_drvdata(&cdev->dev);
372 req = (struct raw3215_req *) intparm; 372 req = (struct raw3215_req *) intparm;
373 cstat = irb->scsw.cmd.cstat; 373 cstat = irb->scsw.cmd.cstat;
374 dstat = irb->scsw.cmd.dstat; 374 dstat = irb->scsw.cmd.dstat;
@@ -635,7 +635,7 @@ raw3215_probe (struct ccw_device *cdev)
635 int line; 635 int line;
636 636
637 /* Console is special. */ 637 /* Console is special. */
638 if (raw3215[0] && (cdev->dev.driver_data == raw3215[0])) 638 if (raw3215[0] && (raw3215[0] == dev_get_drvdata(&cdev->dev)))
639 return 0; 639 return 0;
640 raw = kmalloc(sizeof(struct raw3215_info) + 640 raw = kmalloc(sizeof(struct raw3215_info) +
641 RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA); 641 RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA);
@@ -669,7 +669,7 @@ raw3215_probe (struct ccw_device *cdev)
669 } 669 }
670 init_waitqueue_head(&raw->empty_wait); 670 init_waitqueue_head(&raw->empty_wait);
671 671
672 cdev->dev.driver_data = raw; 672 dev_set_drvdata(&cdev->dev, raw);
673 cdev->handler = raw3215_irq; 673 cdev->handler = raw3215_irq;
674 674
675 return 0; 675 return 0;
@@ -681,9 +681,9 @@ raw3215_remove (struct ccw_device *cdev)
681 struct raw3215_info *raw; 681 struct raw3215_info *raw;
682 682
683 ccw_device_set_offline(cdev); 683 ccw_device_set_offline(cdev);
684 raw = cdev->dev.driver_data; 684 raw = dev_get_drvdata(&cdev->dev);
685 if (raw) { 685 if (raw) {
686 cdev->dev.driver_data = NULL; 686 dev_set_drvdata(&cdev->dev, NULL);
687 kfree(raw->buffer); 687 kfree(raw->buffer);
688 kfree(raw); 688 kfree(raw);
689 } 689 }
@@ -694,7 +694,7 @@ raw3215_set_online (struct ccw_device *cdev)
694{ 694{
695 struct raw3215_info *raw; 695 struct raw3215_info *raw;
696 696
697 raw = cdev->dev.driver_data; 697 raw = dev_get_drvdata(&cdev->dev);
698 if (!raw) 698 if (!raw)
699 return -ENODEV; 699 return -ENODEV;
700 700
@@ -706,7 +706,7 @@ raw3215_set_offline (struct ccw_device *cdev)
706{ 706{
707 struct raw3215_info *raw; 707 struct raw3215_info *raw;
708 708
709 raw = cdev->dev.driver_data; 709 raw = dev_get_drvdata(&cdev->dev);
710 if (!raw) 710 if (!raw)
711 return -ENODEV; 711 return -ENODEV;
712 712
@@ -848,7 +848,7 @@ con3215_init(void)
848 raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE); 848 raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE);
849 raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE); 849 raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE);
850 raw->cdev = cdev; 850 raw->cdev = cdev;
851 cdev->dev.driver_data = raw; 851 dev_set_drvdata(&cdev->dev, raw);
852 cdev->handler = raw3215_irq; 852 cdev->handler = raw3215_irq;
853 853
854 raw->flags |= RAW3215_FIXED; 854 raw->flags |= RAW3215_FIXED;