From 67393c4fef245f46863f50bc8a553f0608d7a05d Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 12 Aug 2014 11:41:20 -0700 Subject: [PATCH] staging: comedi: ni_mio_common: tidy up ni_8255_callback() The 8255 driver (*io) callback now includes the comedi_device pointer. Instead of passing the (cast) pointer to subdev_8255_init(), pass the 'iobase' of the 8255 registers (Port_A). Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 07659053f4d3..8b3ba40cb74c 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -4176,17 +4176,15 @@ static int ni_freq_out_insn_config(struct comedi_device *dev, return insn->n; } -static int ni_8255_callback(struct comedi_device *cdev, - int dir, int port, int data, unsigned long arg) +static int ni_8255_callback(struct comedi_device *dev, + int dir, int port, int data, unsigned long iobase) { - struct comedi_device *dev = (struct comedi_device *)arg; - if (dir) { - ni_writeb(dev, data, Port_A + 2 * port); + ni_writeb(dev, data, iobase + 2 * port); return 0; } - return ni_readb(dev, Port_A + 2 * port); + return ni_readb(dev, iobase + 2 * port); } static int ni_get_pwm_config(struct comedi_device *dev, unsigned int *data) @@ -5561,8 +5559,7 @@ static int ni_E_init(struct comedi_device *dev, /* 8255 device */ s = &dev->subdevices[NI_8255_DIO_SUBDEV]; if (board->has_8255) { - ret = subdev_8255_init(dev, s, ni_8255_callback, - (unsigned long)dev); + ret = subdev_8255_init(dev, s, ni_8255_callback, Port_A); if (ret) return ret; } else { -- 2.39.5