Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21208519 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: drivers: use comedi_legacy_detach() in simple drivers



Use the new comedi_legacy_detach() helper in the (*detach) to release
the I/O region requested by these drivers.

Since the (*detach) for these drivers only releases the region, remove
the private (*detach) functions and use comedi_legacy_detach() directly
for the (*detach).

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e608796a
Loading
Loading
Loading
Loading
+1 −9
Original line number Original line Diff line number Diff line
@@ -120,19 +120,11 @@ static int acl7225b_attach(struct comedi_device *dev,
	return 0;
	return 0;
}
}


static void acl7225b_detach(struct comedi_device *dev)
{
	const struct acl7225b_boardinfo *board = comedi_board(dev);

	if (dev->iobase)
		release_region(dev->iobase, board->io_range);
}

static struct comedi_driver acl7225b_driver = {
static struct comedi_driver acl7225b_driver = {
	.driver_name	= "acl7225b",
	.driver_name	= "acl7225b",
	.module		= THIS_MODULE,
	.module		= THIS_MODULE,
	.attach		= acl7225b_attach,
	.attach		= acl7225b_attach,
	.detach		= acl7225b_detach,
	.detach		= comedi_legacy_detach,
	.board_name	= &acl7225b_boards[0].name,
	.board_name	= &acl7225b_boards[0].name,
	.num_names	= ARRAY_SIZE(acl7225b_boards),
	.num_names	= ARRAY_SIZE(acl7225b_boards),
	.offset		= sizeof(struct acl7225b_boardinfo),
	.offset		= sizeof(struct acl7225b_boardinfo),
+1 −7
Original line number Original line Diff line number Diff line
@@ -281,17 +281,11 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	return 0;
	return 0;
}
}


static void adq12b_detach(struct comedi_device *dev)
{
	if (dev->iobase)
		release_region(dev->iobase, ADQ12B_SIZE);
}

static struct comedi_driver adq12b_driver = {
static struct comedi_driver adq12b_driver = {
	.driver_name	= "adq12b",
	.driver_name	= "adq12b",
	.module		= THIS_MODULE,
	.module		= THIS_MODULE,
	.attach		= adq12b_attach,
	.attach		= adq12b_attach,
	.detach		= adq12b_detach,
	.detach		= comedi_legacy_detach,
};
};
module_comedi_driver(adq12b_driver);
module_comedi_driver(adq12b_driver);


+1 −7
Original line number Original line Diff line number Diff line
@@ -107,17 +107,11 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
	return 1;
	return 1;
}
}


static void aio_iiro_16_detach(struct comedi_device *dev)
{
	if (dev->iobase)
		release_region(dev->iobase, AIO_IIRO_16_SIZE);
}

static struct comedi_driver aio_iiro_16_driver = {
static struct comedi_driver aio_iiro_16_driver = {
	.driver_name	= "aio_iiro_16",
	.driver_name	= "aio_iiro_16",
	.module		= THIS_MODULE,
	.module		= THIS_MODULE,
	.attach		= aio_iiro_16_attach,
	.attach		= aio_iiro_16_attach,
	.detach		= aio_iiro_16_detach,
	.detach		= comedi_legacy_detach,
};
};
module_comedi_driver(aio_iiro_16_driver);
module_comedi_driver(aio_iiro_16_driver);


+1 −7
Original line number Original line Diff line number Diff line
@@ -104,17 +104,11 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	return 0;
	return 0;
}
}


static void pc263_detach(struct comedi_device *dev)
{
	if (dev->iobase)
		release_region(dev->iobase, PC263_IO_SIZE);
}

static struct comedi_driver amplc_pc263_driver = {
static struct comedi_driver amplc_pc263_driver = {
	.driver_name = PC263_DRIVER_NAME,
	.driver_name = PC263_DRIVER_NAME,
	.module = THIS_MODULE,
	.module = THIS_MODULE,
	.attach = pc263_attach,
	.attach = pc263_attach,
	.detach = pc263_detach,
	.detach = comedi_legacy_detach,
	.board_name = &pc263_boards[0].name,
	.board_name = &pc263_boards[0].name,
	.offset = sizeof(struct pc263_board),
	.offset = sizeof(struct pc263_board),
	.num_names = ARRAY_SIZE(pc263_boards),
	.num_names = ARRAY_SIZE(pc263_boards),
+1 −7
Original line number Original line Diff line number Diff line
@@ -687,17 +687,11 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	return ret;
	return ret;
}
}


static void dt2801_detach(struct comedi_device *dev)
{
	if (dev->iobase)
		release_region(dev->iobase, DT2801_IOSIZE);
}

static struct comedi_driver dt2801_driver = {
static struct comedi_driver dt2801_driver = {
	.driver_name	= "dt2801",
	.driver_name	= "dt2801",
	.module		= THIS_MODULE,
	.module		= THIS_MODULE,
	.attach		= dt2801_attach,
	.attach		= dt2801_attach,
	.detach		= dt2801_detach,
	.detach		= comedi_legacy_detach,
};
};
module_comedi_driver(dt2801_driver);
module_comedi_driver(dt2801_driver);


Loading