Commit d61780c0 authored by Jeff Garzik's avatar Jeff Garzik Committed by Linus Torvalds

[PATCH] remove some more check_region stuff

Removed some more references to check_region().

I checked these changes into the 'checkreg' branch of
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git

The only valid references remaining are in:
drivers/scsi/advansys.c
drivers/scsi/BusLogic.c
drivers/cdrom/sbpcd.c
sound/oss/pss.c

  Remove last vestiges of ide_check_region()
  drivers/char/specialix: trim trailing whitespace
  drivers/char/specialix: eliminate use of check_region()
  Remove outdated and unused references to check_region()
  [sound oss] remove check_region() usage from cs4232, wavfront
  [netdrvr eepro] trim trailing whitespace
  [netdrvr eepro] remove check_region() usage
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 34ad92c2
...@@ -273,6 +273,7 @@ For now, you can ignore the `flags' parameter. It is there for future use. ...@@ -273,6 +273,7 @@ For now, you can ignore the `flags' parameter. It is there for future use.
if (is_isa) { if (is_isa) {
/* Discard immediately if this ISA range is already used */ /* Discard immediately if this ISA range is already used */
/* FIXME: never use check_region(), only request_region() */
if (check_region(address,FOO_EXTENT)) if (check_region(address,FOO_EXTENT))
goto ERROR0; goto ERROR0;
......
...@@ -609,11 +609,6 @@ static void parse_bootinfo(unsigned long r3, ...@@ -609,11 +609,6 @@ static void parse_bootinfo(unsigned long r3,
} }
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
static int hdpu_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void static void
hdpu_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) hdpu_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name)
{ {
......
...@@ -497,8 +497,8 @@ static void pcic_map_pci_device(struct linux_pcic *pcic, ...@@ -497,8 +497,8 @@ static void pcic_map_pci_device(struct linux_pcic *pcic,
* CheerIO makes a similar conversion. * CheerIO makes a similar conversion.
* See ebus.c for details. * See ebus.c for details.
* *
* Note that check_region()/request_region() * Note that request_region()
* work for these devices. * works for these devices.
* *
* XXX Neat trick, but it's a *bad* idea * XXX Neat trick, but it's a *bad* idea
* to shit into regions like that. * to shit into regions like that.
......
This diff is collapsed.
...@@ -552,8 +552,7 @@ static int __init do_eepro_probe(struct net_device *dev) ...@@ -552,8 +552,7 @@ static int __init do_eepro_probe(struct net_device *dev)
{ {
unsigned short int WS[32]=WakeupSeq; unsigned short int WS[32]=WakeupSeq;
if (check_region(WakeupPort, 2)==0) { if (request_region(WakeupPort, 2, "eepro wakeup")) {
if (net_debug>5) if (net_debug>5)
printk(KERN_DEBUG "Waking UP\n"); printk(KERN_DEBUG "Waking UP\n");
...@@ -563,7 +562,10 @@ static int __init do_eepro_probe(struct net_device *dev) ...@@ -563,7 +562,10 @@ static int __init do_eepro_probe(struct net_device *dev)
outb_p(WS[i],WakeupPort); outb_p(WS[i],WakeupPort);
if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]); if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]);
} }
} else printk(KERN_WARNING "Checkregion Failed!\n");
release_region(WakeupPort, 2);
} else
printk(KERN_WARNING "PnP wakeup region busy!\n");
} }
#endif #endif
...@@ -705,7 +707,7 @@ static void __init eepro_print_info (struct net_device *dev) ...@@ -705,7 +707,7 @@ static void __init eepro_print_info (struct net_device *dev)
dev->name, (unsigned)dev->base_addr); dev->name, (unsigned)dev->base_addr);
break; break;
case LAN595FX: case LAN595FX:
printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,", printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,",
dev->name, (unsigned)dev->base_addr); dev->name, (unsigned)dev->base_addr);
break; break;
case LAN595TX: case LAN595TX:
...@@ -713,7 +715,7 @@ static void __init eepro_print_info (struct net_device *dev) ...@@ -713,7 +715,7 @@ static void __init eepro_print_info (struct net_device *dev)
dev->name, (unsigned)dev->base_addr); dev->name, (unsigned)dev->base_addr);
break; break;
case LAN595: case LAN595:
printk("%s: Intel 82595-based lan card at %#x,", printk("%s: Intel 82595-based lan card at %#x,",
dev->name, (unsigned)dev->base_addr); dev->name, (unsigned)dev->base_addr);
} }
...@@ -726,7 +728,7 @@ static void __init eepro_print_info (struct net_device *dev) ...@@ -726,7 +728,7 @@ static void __init eepro_print_info (struct net_device *dev)
if (dev->irq > 2) if (dev->irq > 2)
printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]); printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]);
else else
printk(", %s.\n", ifmap[dev->if_port]); printk(", %s.\n", ifmap[dev->if_port]);
if (net_debug > 3) { if (net_debug > 3) {
...@@ -756,7 +758,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) ...@@ -756,7 +758,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
int err; int err;
/* Grab the region so we can find another board if autoIRQ fails. */ /* Grab the region so we can find another board if autoIRQ fails. */
if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) {
if (!autoprobe) if (!autoprobe)
printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n",
ioaddr); ioaddr);
...@@ -838,15 +840,15 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) ...@@ -838,15 +840,15 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
/* Mask off INT number */ /* Mask off INT number */
int count = lp->word[1] & 7; int count = lp->word[1] & 7;
unsigned irqMask = lp->word[7]; unsigned irqMask = lp->word[7];
while (count--) while (count--)
irqMask &= irqMask - 1; irqMask &= irqMask - 1;
count = ffs(irqMask); count = ffs(irqMask);
if (count) if (count)
dev->irq = count - 1; dev->irq = count - 1;
if (dev->irq < 2) { if (dev->irq < 2) {
printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n"); printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n");
goto exit; goto exit;
...@@ -854,7 +856,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) ...@@ -854,7 +856,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
dev->irq = 9; dev->irq = 9;
} }
} }
dev->open = eepro_open; dev->open = eepro_open;
dev->stop = eepro_close; dev->stop = eepro_close;
dev->hard_start_xmit = eepro_send_packet; dev->hard_start_xmit = eepro_send_packet;
...@@ -863,7 +865,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) ...@@ -863,7 +865,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
dev->tx_timeout = eepro_tx_timeout; dev->tx_timeout = eepro_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
dev->ethtool_ops = &eepro_ethtool_ops; dev->ethtool_ops = &eepro_ethtool_ops;
/* print boot time info */ /* print boot time info */
eepro_print_info(dev); eepro_print_info(dev);
...@@ -1047,8 +1049,8 @@ static int eepro_open(struct net_device *dev) ...@@ -1047,8 +1049,8 @@ static int eepro_open(struct net_device *dev)
/* Initialize the RCV and XMT upper and lower limits */ /* Initialize the RCV and XMT upper and lower limits */
outb(lp->rcv_lower_limit >> 8, ioaddr + RCV_LOWER_LIMIT_REG); outb(lp->rcv_lower_limit >> 8, ioaddr + RCV_LOWER_LIMIT_REG);
outb(lp->rcv_upper_limit >> 8, ioaddr + RCV_UPPER_LIMIT_REG); outb(lp->rcv_upper_limit >> 8, ioaddr + RCV_UPPER_LIMIT_REG);
outb(lp->xmt_lower_limit >> 8, ioaddr + lp->xmt_lower_limit_reg); outb(lp->xmt_lower_limit >> 8, ioaddr + lp->xmt_lower_limit_reg);
outb(lp->xmt_upper_limit >> 8, ioaddr + lp->xmt_upper_limit_reg); outb(lp->xmt_upper_limit >> 8, ioaddr + lp->xmt_upper_limit_reg);
...@@ -1065,12 +1067,12 @@ static int eepro_open(struct net_device *dev) ...@@ -1065,12 +1067,12 @@ static int eepro_open(struct net_device *dev)
eepro_clear_int(ioaddr); eepro_clear_int(ioaddr);
/* Initialize RCV */ /* Initialize RCV */
outw(lp->rcv_lower_limit, ioaddr + RCV_BAR); outw(lp->rcv_lower_limit, ioaddr + RCV_BAR);
lp->rx_start = lp->rcv_lower_limit; lp->rx_start = lp->rcv_lower_limit;
outw(lp->rcv_upper_limit | 0xfe, ioaddr + RCV_STOP); outw(lp->rcv_upper_limit | 0xfe, ioaddr + RCV_STOP);
/* Initialize XMT */ /* Initialize XMT */
outw(lp->xmt_lower_limit, ioaddr + lp->xmt_bar); outw(lp->xmt_lower_limit, ioaddr + lp->xmt_bar);
lp->tx_start = lp->tx_end = lp->xmt_lower_limit; lp->tx_start = lp->tx_end = lp->xmt_lower_limit;
lp->tx_last = 0; lp->tx_last = 0;
...@@ -1411,7 +1413,7 @@ set_multicast_list(struct net_device *dev) ...@@ -1411,7 +1413,7 @@ set_multicast_list(struct net_device *dev)
outb(0x08, ioaddr + STATUS_REG); outb(0x08, ioaddr + STATUS_REG);
if (i & 0x20) { /* command ABORTed */ if (i & 0x20) { /* command ABORTed */
printk(KERN_NOTICE "%s: multicast setup failed.\n", printk(KERN_NOTICE "%s: multicast setup failed.\n",
dev->name); dev->name);
break; break;
} else if ((i & 0x0f) == 0x03) { /* MC-Done */ } else if ((i & 0x0f) == 0x03) { /* MC-Done */
...@@ -1512,7 +1514,7 @@ hardware_send_packet(struct net_device *dev, void *buf, short length) ...@@ -1512,7 +1514,7 @@ hardware_send_packet(struct net_device *dev, void *buf, short length)
end = last + (((length + 3) >> 1) << 1) + XMT_HEADER; end = last + (((length + 3) >> 1) << 1) + XMT_HEADER;
if (end >= lp->xmt_upper_limit + 2) { /* the transmit buffer is wrapped around */ if (end >= lp->xmt_upper_limit + 2) { /* the transmit buffer is wrapped around */
if ((lp->xmt_upper_limit + 2 - last) <= XMT_HEADER) { if ((lp->xmt_upper_limit + 2 - last) <= XMT_HEADER) {
/* Arrrr!!!, must keep the xmt header together, /* Arrrr!!!, must keep the xmt header together,
several days were lost to chase this one down. */ several days were lost to chase this one down. */
last = lp->xmt_lower_limit; last = lp->xmt_lower_limit;
...@@ -1643,7 +1645,7 @@ eepro_rx(struct net_device *dev) ...@@ -1643,7 +1645,7 @@ eepro_rx(struct net_device *dev)
else if (rcv_status & 0x0800) else if (rcv_status & 0x0800)
lp->stats.rx_crc_errors++; lp->stats.rx_crc_errors++;
printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n", printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n",
dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size); dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size);
} }
...@@ -1674,10 +1676,10 @@ eepro_transmit_interrupt(struct net_device *dev) ...@@ -1674,10 +1676,10 @@ eepro_transmit_interrupt(struct net_device *dev)
{ {
struct eepro_local *lp = netdev_priv(dev); struct eepro_local *lp = netdev_priv(dev);
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
short boguscount = 25; short boguscount = 25;
short xmt_status; short xmt_status;
while ((lp->tx_start != lp->tx_end) && boguscount--) { while ((lp->tx_start != lp->tx_end) && boguscount--) {
outw(lp->tx_start, ioaddr + HOST_ADDRESS_REG); outw(lp->tx_start, ioaddr + HOST_ADDRESS_REG);
xmt_status = inw(ioaddr+IO_PORT); xmt_status = inw(ioaddr+IO_PORT);
...@@ -1723,7 +1725,7 @@ static int eepro_ethtool_get_settings(struct net_device *dev, ...@@ -1723,7 +1725,7 @@ static int eepro_ethtool_get_settings(struct net_device *dev,
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = (struct eepro_local *)dev->priv;
cmd->supported = SUPPORTED_10baseT_Half | cmd->supported = SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Full |
SUPPORTED_Autoneg; SUPPORTED_Autoneg;
cmd->advertising = ADVERTISED_10baseT_Half | cmd->advertising = ADVERTISED_10baseT_Half |
......
...@@ -27,10 +27,8 @@ ...@@ -27,10 +27,8 @@
/* We don't need no stinkin' I/O port allocation crap. */ /* We don't need no stinkin' I/O port allocation crap. */
#undef release_region #undef release_region
#undef check_region
#undef request_region #undef request_region
#define release_region(X, Y) do { } while(0) #define release_region(X, Y) do { } while(0)
#define check_region(X, Y) (0)
#define request_region(X, Y, Z) (1) #define request_region(X, Y, Z) (1)
struct sun3xflop_private { struct sun3xflop_private {
......
...@@ -163,13 +163,6 @@ ide_free_irq(unsigned int irq, void *dev_id) ...@@ -163,13 +163,6 @@ ide_free_irq(unsigned int irq, void *dev_id)
} }
static IDE_INLINE int
ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return 0;
}
static IDE_INLINE void static IDE_INLINE void
ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name)
{ {
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name)) #define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent)) #define ide_release_region(from,extent) release_region((from), (extent))
/* Generic I/O and MEMIO string operations. */ /* Generic I/O and MEMIO string operations. */
......
...@@ -17,10 +17,8 @@ ...@@ -17,10 +17,8 @@
/* We don't need no stinkin' I/O port allocation crap. */ /* We don't need no stinkin' I/O port allocation crap. */
#undef release_region #undef release_region
#undef check_region
#undef request_region #undef request_region
#define release_region(X, Y) do { } while(0) #define release_region(X, Y) do { } while(0)
#define check_region(X, Y) (0)
#define request_region(X, Y, Z) (1) #define request_region(X, Y, Z) (1)
/* References: /* References:
......
...@@ -195,10 +195,12 @@ static int __init probe_cs4232(struct address_info *hw_config, int isapnp_config ...@@ -195,10 +195,12 @@ static int __init probe_cs4232(struct address_info *hw_config, int isapnp_config
CS_OUT2(0x15, 0x00); /* Select logical device 0 (WSS/SB/FM) */ CS_OUT2(0x15, 0x00); /* Select logical device 0 (WSS/SB/FM) */
CS_OUT3(0x47, (base >> 8) & 0xff, base & 0xff); /* WSS base */ CS_OUT3(0x47, (base >> 8) & 0xff, base & 0xff); /* WSS base */
if (check_region(0x388, 4)) /* Not free */ if (!request_region(0x388, 4, "FM")) /* Not free */
CS_OUT3(0x48, 0x00, 0x00) /* FM base off */ CS_OUT3(0x48, 0x00, 0x00) /* FM base off */
else else {
release_region(0x388, 4);
CS_OUT3(0x48, 0x03, 0x88); /* FM base 0x388 */ CS_OUT3(0x48, 0x03, 0x88); /* FM base 0x388 */
}
CS_OUT3(0x42, 0x00, 0x00); /* SB base off */ CS_OUT3(0x42, 0x00, 0x00); /* SB base off */
CS_OUT2(0x22, irq); /* SB+WSS IRQ */ CS_OUT2(0x22, irq); /* SB+WSS IRQ */
......
...@@ -2434,7 +2434,7 @@ static int __init detect_wavefront (int irq, int io_base) ...@@ -2434,7 +2434,7 @@ static int __init detect_wavefront (int irq, int io_base)
consumes 16. consumes 16.
*/ */
if (check_region (io_base, 16)) { if (!request_region (io_base, 16, "wavfront")) {
printk (KERN_ERR LOGNAME "IO address range 0x%x - 0x%x " printk (KERN_ERR LOGNAME "IO address range 0x%x - 0x%x "
"already in use - ignored\n", dev.base, "already in use - ignored\n", dev.base,
dev.base+15); dev.base+15);
...@@ -2466,10 +2466,13 @@ static int __init detect_wavefront (int irq, int io_base) ...@@ -2466,10 +2466,13 @@ static int __init detect_wavefront (int irq, int io_base)
} else { } else {
printk (KERN_WARNING LOGNAME "not raw, but no " printk (KERN_WARNING LOGNAME "not raw, but no "
"hardware version!\n"); "hardware version!\n");
release_region (io_base, 16);
return 0; return 0;
} }
if (!wf_raw) { if (!wf_raw) {
/* will re-acquire region in install_wavefront() */
release_region (io_base, 16);
return 1; return 1;
} else { } else {
printk (KERN_INFO LOGNAME printk (KERN_INFO LOGNAME
...@@ -2489,6 +2492,7 @@ static int __init detect_wavefront (int irq, int io_base) ...@@ -2489,6 +2492,7 @@ static int __init detect_wavefront (int irq, int io_base)
if (wavefront_hw_reset ()) { if (wavefront_hw_reset ()) {
printk (KERN_WARNING LOGNAME "hardware reset failed\n"); printk (KERN_WARNING LOGNAME "hardware reset failed\n");
release_region (io_base, 16);
return 0; return 0;
} }
...@@ -2496,6 +2500,8 @@ static int __init detect_wavefront (int irq, int io_base) ...@@ -2496,6 +2500,8 @@ static int __init detect_wavefront (int irq, int io_base)
dev.has_fx = (detect_wffx () == 0); dev.has_fx = (detect_wffx () == 0);
/* will re-acquire region in install_wavefront() */
release_region (io_base, 16);
return 1; return 1;
} }
...@@ -2804,17 +2810,27 @@ static int __init wavefront_init (int atboot) ...@@ -2804,17 +2810,27 @@ static int __init wavefront_init (int atboot)
} }
static int __init install_wavefront (void) static int __init install_wavefront (void)
{ {
if (!request_region (dev.base+2, 6, "wavefront synth"))
return -1;
if (dev.has_fx) {
if (!request_region (dev.base+8, 8, "wavefront fx")) {
release_region (dev.base+2, 6);
return -1;
}
}
if ((dev.synth_dev = register_sound_synth (&wavefront_fops, -1)) < 0) { if ((dev.synth_dev = register_sound_synth (&wavefront_fops, -1)) < 0) {
printk (KERN_ERR LOGNAME "cannot register raw synth\n"); printk (KERN_ERR LOGNAME "cannot register raw synth\n");
return -1; goto err_out;
} }
#if OSS_SUPPORT_LEVEL & OSS_SUPPORT_SEQ #if OSS_SUPPORT_LEVEL & OSS_SUPPORT_SEQ
if ((dev.oss_dev = sound_alloc_synthdev()) == -1) { if ((dev.oss_dev = sound_alloc_synthdev()) == -1) {
printk (KERN_ERR LOGNAME "Too many sequencers\n"); printk (KERN_ERR LOGNAME "Too many sequencers\n");
return -1; /* FIXME: leak: should unregister sound synth */
goto err_out;
} else { } else {
synth_devs[dev.oss_dev] = &wavefront_operations; synth_devs[dev.oss_dev] = &wavefront_operations;
} }
...@@ -2827,20 +2843,20 @@ static int __init install_wavefront (void) ...@@ -2827,20 +2843,20 @@ static int __init install_wavefront (void)
sound_unload_synthdev (dev.oss_dev); sound_unload_synthdev (dev.oss_dev);
#endif /* OSS_SUPPORT_SEQ */ #endif /* OSS_SUPPORT_SEQ */
return -1; goto err_out;
} }
request_region (dev.base+2, 6, "wavefront synth");
if (dev.has_fx) {
request_region (dev.base+8, 8, "wavefront fx");
}
if (wavefront_config_midi ()) { if (wavefront_config_midi ()) {
printk (KERN_WARNING LOGNAME "could not initialize MIDI.\n"); printk (KERN_WARNING LOGNAME "could not initialize MIDI.\n");
} }
return dev.oss_dev; return dev.oss_dev;
err_out:
release_region (dev.base+2, 6);
if (dev.has_fx)
release_region (dev.base+8, 8);
return -1;
} }
static void __exit uninstall_wavefront (void) static void __exit uninstall_wavefront (void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment