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: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2013-04-18 14:33:22 -07:00 коммит произвёл Greg Kroah-Hartman
Родитель e608796ab6
Коммит 21208519d4
19 изменённых файлов: 19 добавлений и 139 удалений

Просмотреть файл

@ -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),

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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),

Просмотреть файл

@ -687,17 +687,11 @@ out:
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);

Просмотреть файл

@ -220,17 +220,11 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void dt2815_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, DT2815_SIZE);
}
static struct comedi_driver dt2815_driver = { static struct comedi_driver dt2815_driver = {
.driver_name = "dt2815", .driver_name = "dt2815",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = dt2815_attach, .attach = dt2815_attach,
.detach = dt2815_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(dt2815_driver); module_comedi_driver(dt2815_driver);

Просмотреть файл

@ -151,17 +151,11 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void dt2817_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, DT2817_SIZE);
}
static struct comedi_driver dt2817_driver = { static struct comedi_driver dt2817_driver = {
.driver_name = "dt2817", .driver_name = "dt2817",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = dt2817_attach, .attach = dt2817_attach,
.detach = dt2817_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(dt2817_driver); module_comedi_driver(dt2817_driver);

Просмотреть файл

@ -165,17 +165,11 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 1; return 1;
} }
static void fl512_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, FL512_SIZE);
}
static struct comedi_driver fl512_driver = { static struct comedi_driver fl512_driver = {
.driver_name = "fl512", .driver_name = "fl512",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = fl512_attach, .attach = fl512_attach,
.detach = fl512_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(fl512_driver); module_comedi_driver(fl512_driver);

Просмотреть файл

@ -357,17 +357,11 @@ static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 1; return 1;
} }
static void mpc624_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, MPC624_SIZE);
}
static struct comedi_driver mpc624_driver = { static struct comedi_driver mpc624_driver = {
.driver_name = "mpc624", .driver_name = "mpc624",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = mpc624_attach, .attach = mpc624_attach,
.detach = mpc624_detach .detach = comedi_legacy_detach,
}; };
module_comedi_driver(mpc624_driver); module_comedi_driver(mpc624_driver);

Просмотреть файл

@ -294,17 +294,11 @@ static int multiq3_attach(struct comedi_device *dev,
return 0; return 0;
} }
static void multiq3_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, MULTIQ3_SIZE);
}
static struct comedi_driver multiq3_driver = { static struct comedi_driver multiq3_driver = {
.driver_name = "multiq3", .driver_name = "multiq3",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = multiq3_attach, .attach = multiq3_attach,
.detach = multiq3_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(multiq3_driver); module_comedi_driver(multiq3_driver);

Просмотреть файл

@ -399,12 +399,6 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void atao_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, ATAO_SIZE);
}
static const struct atao_board atao_boards[] = { static const struct atao_board atao_boards[] = {
{ {
.name = "ai-ao-6", .name = "ai-ao-6",
@ -419,7 +413,7 @@ static struct comedi_driver ni_at_ao_driver = {
.driver_name = "ni_at_ao", .driver_name = "ni_at_ao",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = atao_attach, .attach = atao_attach,
.detach = atao_detach, .detach = comedi_legacy_detach,
.board_name = &atao_boards[0].name, .board_name = &atao_boards[0].name,
.offset = sizeof(struct atao_board), .offset = sizeof(struct atao_board),
.num_names = ARRAY_SIZE(atao_boards), .num_names = ARRAY_SIZE(atao_boards),

Просмотреть файл

@ -78,17 +78,11 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void pcl725_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, PCL725_SIZE);
}
static struct comedi_driver pcl725_driver = { static struct comedi_driver pcl725_driver = {
.driver_name = "pcl725", .driver_name = "pcl725",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = pcl725_attach, .attach = pcl725_attach,
.detach = pcl725_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(pcl725_driver); module_comedi_driver(pcl725_driver);

Просмотреть файл

@ -119,14 +119,6 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void pcl730_detach(struct comedi_device *dev)
{
const struct pcl730_board *board = comedi_board(dev);
if (dev->iobase)
release_region(dev->iobase, board->io_range);
}
static const struct pcl730_board boardtypes[] = { static const struct pcl730_board boardtypes[] = {
{ "pcl730", PCL730_SIZE, }, { "pcl730", PCL730_SIZE, },
{ "iso730", PCL730_SIZE, }, { "iso730", PCL730_SIZE, },
@ -137,7 +129,7 @@ static struct comedi_driver pcl730_driver = {
.driver_name = "pcl730", .driver_name = "pcl730",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = pcl730_attach, .attach = pcl730_attach,
.detach = pcl730_detach, .detach = comedi_legacy_detach,
.board_name = &boardtypes[0].name, .board_name = &boardtypes[0].name,
.num_names = ARRAY_SIZE(boardtypes), .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl730_board), .offset = sizeof(struct pcl730_board),

Просмотреть файл

@ -123,17 +123,11 @@ static int pcm3730_attach(struct comedi_device *dev,
return 0; return 0;
} }
static void pcm3730_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, PCM3730_SIZE);
}
static struct comedi_driver pcm3730_driver = { static struct comedi_driver pcm3730_driver = {
.driver_name = "pcm3730", .driver_name = "pcm3730",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = pcm3730_attach, .attach = pcm3730_attach,
.detach = pcm3730_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(pcm3730_driver); module_comedi_driver(pcm3730_driver);

Просмотреть файл

@ -186,17 +186,11 @@ static int pcmda12_attach(struct comedi_device *dev,
return 1; return 1;
} }
static void pcmda12_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, IOSIZE);
}
static struct comedi_driver pcmda12_driver = { static struct comedi_driver pcmda12_driver = {
.driver_name = "pcmda12", .driver_name = "pcmda12",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = pcmda12_attach, .attach = pcmda12_attach,
.detach = pcmda12_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(pcmda12_driver); module_comedi_driver(pcmda12_driver);

Просмотреть файл

@ -169,14 +169,6 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void poc_detach(struct comedi_device *dev)
{
const struct boarddef_struct *board = comedi_board(dev);
if (dev->iobase)
release_region(dev->iobase, board->iosize);
}
static const struct boarddef_struct boards[] = { static const struct boarddef_struct boards[] = {
{ {
.name = "dac02", .name = "dac02",
@ -211,7 +203,7 @@ static struct comedi_driver poc_driver = {
.driver_name = "poc", .driver_name = "poc",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = poc_attach, .attach = poc_attach,
.detach = poc_detach, .detach = comedi_legacy_detach,
.board_name = &boards[0].name, .board_name = &boards[0].name,
.num_names = ARRAY_SIZE(boards), .num_names = ARRAY_SIZE(boards),
.offset = sizeof(boards[0]), .offset = sizeof(boards[0]),

Просмотреть файл

@ -376,17 +376,11 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void rti800_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, RTI800_IOSIZE);
}
static struct comedi_driver rti800_driver = { static struct comedi_driver rti800_driver = {
.driver_name = "rti800", .driver_name = "rti800",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = rti800_attach, .attach = rti800_attach,
.detach = rti800_detach, .detach = comedi_legacy_detach,
.num_names = ARRAY_SIZE(rti800_boardtypes), .num_names = ARRAY_SIZE(rti800_boardtypes),
.board_name = &rti800_boardtypes[0].name, .board_name = &rti800_boardtypes[0].name,
.offset = sizeof(struct rti800_board), .offset = sizeof(struct rti800_board),

Просмотреть файл

@ -128,17 +128,11 @@ static int rti802_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; return 0;
} }
static void rti802_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, RTI802_SIZE);
}
static struct comedi_driver rti802_driver = { static struct comedi_driver rti802_driver = {
.driver_name = "rti802", .driver_name = "rti802",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = rti802_attach, .attach = rti802_attach,
.detach = rti802_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(rti802_driver); module_comedi_driver(rti802_driver);

Просмотреть файл

@ -613,17 +613,11 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return 1; return 1;
} }
static void s526_detach(struct comedi_device *dev)
{
if (dev->iobase > 0)
release_region(dev->iobase, S526_IOSIZE);
}
static struct comedi_driver s526_driver = { static struct comedi_driver s526_driver = {
.driver_name = "s526", .driver_name = "s526",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = s526_attach, .attach = s526_attach,
.detach = s526_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(s526_driver); module_comedi_driver(s526_driver);