2007-11-20 09:51:55

by Thomas Renninger

[permalink] [raw]
Subject: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

Unify the pnp macros to access resources in the pnp resource table

port, mem, dma and irq resource macros are now all used in the same
way. This is the basis (or makes it at least easier) for changing how
the resources are allocated for memory optimizations.

Signed-off-by: Thomas Renninger <[email protected]>

---
drivers/ata/pata_isapnp.c | 2 -
drivers/char/tpm/tpm_tis.c | 2 -
drivers/ide/ide-pnp.c | 2 -
drivers/input/serio/i8042-x86ia64io.h | 4 +--
drivers/isdn/hisax/asuscom.c | 2 -
drivers/isdn/hisax/avm_pci.c | 2 -
drivers/isdn/hisax/diva.c | 2 -
drivers/isdn/hisax/elsa.c | 2 -
drivers/isdn/hisax/hfc_sx.c | 2 -
drivers/isdn/hisax/hfcscard.c | 2 -
drivers/isdn/hisax/hisax_fcpcipnp.c | 2 -
drivers/isdn/hisax/isurf.c | 2 -
drivers/isdn/hisax/ix1_micro.c | 2 -
drivers/isdn/hisax/niccy.c | 2 -
drivers/isdn/hisax/sedlbauer.c | 2 -
drivers/isdn/hisax/teles3.c | 2 -
drivers/mmc/host/wbsd.c | 4 +--
drivers/net/3c509.c | 2 -
drivers/net/3c515.c | 4 +--
drivers/net/irda/nsc-ircc.c | 4 +--
drivers/net/irda/smsc-ircc2.c | 4 +--
drivers/net/ne.c | 2 -
drivers/net/sb1000.c | 2 -
drivers/net/smc-ultra.c | 2 -
drivers/parport/parport_pc.c | 4 +--
drivers/scsi/aha152x.c | 2 -
drivers/scsi/g_NCR5380.c | 4 +--
drivers/scsi/sym53c416.c | 2 -
drivers/serial/8250_pnp.c | 2 -
include/linux/pnp.h | 2 -
sound/drivers/mpu401/mpu401.c | 2 -
sound/isa/ad1816a/ad1816a.c | 8 +++---
sound/isa/als100.c | 8 +++---
sound/isa/azt2320.c | 8 +++---
sound/isa/cmi8330.c | 10 +++----
sound/isa/cs423x/cs4236.c | 11 ++++----
sound/isa/dt019x.c | 6 ++--
sound/isa/es18xx.c | 12 ++++-----
sound/isa/gus/interwave.c | 6 ++--
sound/isa/opl3sa2.c | 6 ++--
sound/isa/opti9xx/opti92x-ad1848.c | 8 +++---
sound/isa/sb/es968.c | 4 +--
sound/isa/sb/sb16.c | 6 ++--
sound/isa/sscape.c | 8 +++---
sound/isa/wavefront/wavefront.c | 10 +++----
sound/oss/ad1848.c | 6 ++--
sound/oss/sb_card.c | 44 +++++++++++++++++-----------------
47 files changed, 118 insertions(+), 119 deletions(-)

Index: linux-2.6.24-rc2/include/linux/pnp.h
===================================================================
--- linux-2.6.24-rc2.orig/include/linux/pnp.h
+++ linux-2.6.24-rc2/include/linux/pnp.h
@@ -55,7 +55,6 @@ struct pnp_dev;
(pnp_mem_end((dev),(bar)) - \
pnp_mem_start((dev),(bar)) + 1))

-#define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].start)
#define pnp_irq_start(dev,bar) ((dev)->res.irq_resource[(bar)].start)
#define pnp_irq_end(dev,bar) ((dev)->res.irq_resource[(bar)].end)
#define pnp_irq_flags(dev,bar) ((dev)->res.irq_resource[(bar)].flags)
@@ -63,7 +62,6 @@ struct pnp_dev;
((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
== IORESOURCE_IRQ)

-#define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].start)
#define pnp_dma_start(dev,bar) ((dev)->res.dma_resource[(bar)].start)
#define pnp_dma_end(dev,bar) ((dev)->res.dma_resource[(bar)].end)
#define pnp_dma_flags(dev,bar) ((dev)->res.dma_resource[(bar)].flags)
Index: linux-2.6.24-rc2/drivers/input/serio/i8042-x86ia64io.h
===================================================================
--- linux-2.6.24-rc2.orig/drivers/input/serio/i8042-x86ia64io.h
+++ linux-2.6.24-rc2/drivers/input/serio/i8042-x86ia64io.h
@@ -295,7 +295,7 @@ static int i8042_pnp_kbd_probe(struct pn
i8042_pnp_command_reg = pnp_port_start(dev, 1);

if (pnp_irq_valid(dev,0))
- i8042_pnp_kbd_irq = pnp_irq(dev, 0);
+ i8042_pnp_kbd_irq = pnp_irq_start(dev, 0);

strncpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
if (strlen(pnp_dev_name(dev))) {
@@ -316,7 +316,7 @@ static int i8042_pnp_aux_probe(struct pn
i8042_pnp_command_reg = pnp_port_start(dev, 1);

if (pnp_irq_valid(dev, 0))
- i8042_pnp_aux_irq = pnp_irq(dev, 0);
+ i8042_pnp_aux_irq = pnp_irq_start(dev, 0);

strncpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
if (strlen(pnp_dev_name(dev))) {
Index: linux-2.6.24-rc2/drivers/ata/pata_isapnp.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/ata/pata_isapnp.c
+++ linux-2.6.24-rc2/drivers/ata/pata_isapnp.c
@@ -115,7 +115,7 @@ static int isapnp_init_one(struct pnp_de
(unsigned long long)pnp_port_start(idev, 1));

/* activate */
- return ata_host_activate(host, pnp_irq(idev, 0), ata_interrupt, 0,
+ return ata_host_activate(host, pnp_irq_start(idev, 0), ata_interrupt, 0,
&isapnp_sht);
}

Index: linux-2.6.24-rc2/drivers/isdn/hisax/asuscom.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/asuscom.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/asuscom.c
@@ -350,7 +350,7 @@ setup_asuscom(struct IsdnCard *card)
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "AsusPnP:some resources are missing %ld/%lx\n",
card->para[0], card->para[1]);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/avm_pci.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/avm_pci.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/avm_pci.c
@@ -802,7 +802,7 @@ static int __devinit avm_pnp_setup(struc
}
cs->hw.avm.cfg_reg =
pnp_port_start(pnp_avm_d, 0);
- cs->irq = pnp_irq(pnp_avm_d, 0);
+ cs->irq = pnp_irq_start(pnp_avm_d, 0);
if (!cs->irq) {
printk(KERN_ERR "FritzPnP:No IRQ\n");
return(0);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/diva.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/diva.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/diva.c
@@ -1092,7 +1092,7 @@ static int __devinit setup_diva_isapnp(s
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "Diva PnP:some resources are missing %ld/%lx\n",
card->para[0], card->para[1]);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/elsa.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/elsa.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/elsa.c
@@ -941,7 +941,7 @@ setup_elsa_isapnp(struct IsdnCard *card)
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);

if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "Elsa PnP:some resources are missing %ld/%lx\n",
Index: linux-2.6.24-rc2/drivers/isdn/hisax/hfc_sx.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/hfc_sx.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/hfc_sx.c
@@ -1424,7 +1424,7 @@ setup_hfcsx(struct IsdnCard *card)
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
card->para[0], card->para[1]);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/hfcscard.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/hfcscard.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/hfcscard.c
@@ -198,7 +198,7 @@ setup_hfcs(struct IsdnCard *card)
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
card->para[0], card->para[1]);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/hisax_fcpcipnp.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -940,7 +940,7 @@ static int __devinit fcpnp_probe(struct
goto err_free;
}
adapter->io = pnp_port_start(pdev, 0);
- adapter->irq = pnp_irq(pdev, 0);
+ adapter->irq = pnp_irq_start(pdev, 0);

printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
(char *) dev_id->driver_data, adapter->io, adapter->irq);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/isurf.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/isurf.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/isurf.c
@@ -235,7 +235,7 @@ setup_isurf(struct IsdnCard *card)
err = pnp_activate_dev(pnp_d);
cs->hw.isurf.reset = pnp_port_start(pnp_d, 0);
cs->hw.isurf.phymem = pnp_mem_start(pnp_d, 1);
- cs->irq = pnp_irq(pnp_d, 0);
+ cs->irq = pnp_irq_start(pnp_d, 0);
if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/ix1_micro.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/ix1_micro.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/ix1_micro.c
@@ -257,7 +257,7 @@ setup_ix1micro(struct IsdnCard *card)
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "ITK PnP:some resources are missing %ld/%lx\n",
card->para[0], card->para[1]);
Index: linux-2.6.24-rc2/drivers/isdn/hisax/niccy.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/niccy.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/niccy.c
@@ -261,7 +261,7 @@ int __devinit setup_niccy(struct IsdnCar
}
card->para[1] = pnp_port_start(pnp_d, 0);
card->para[2] = pnp_port_start(pnp_d, 1);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1] ||
!card->para[2]) {
printk(KERN_ERR "NiccyPnP:some resources are "
Index: linux-2.6.24-rc2/drivers/isdn/hisax/sedlbauer.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/sedlbauer.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/sedlbauer.c
@@ -559,7 +559,7 @@ setup_sedlbauer_isapnp(struct IsdnCard *
return(0);
}
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);

if (!card->para[0] || !card->para[1]) {
printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n",
Index: linux-2.6.24-rc2/drivers/isdn/hisax/teles3.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/isdn/hisax/teles3.c
+++ linux-2.6.24-rc2/drivers/isdn/hisax/teles3.c
@@ -307,7 +307,7 @@ setup_teles3(struct IsdnCard *card)
card->para[3] = pnp_port_start(pnp_d, 2);
card->para[2] = pnp_port_start(pnp_d, 1);
card->para[1] = pnp_port_start(pnp_d, 0);
- card->para[0] = pnp_irq(pnp_d, 0);
+ card->para[0] = pnp_irq_start(pnp_d, 0);
if (!card->para[0] || !card->para[1] || !card->para[2]) {
printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
card->para[0], card->para[1], card->para[2]);
Index: linux-2.6.24-rc2/drivers/mmc/host/wbsd.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/mmc/host/wbsd.c
+++ linux-2.6.24-rc2/drivers/mmc/host/wbsd.c
@@ -1791,9 +1791,9 @@ wbsd_pnp_probe(struct pnp_dev *pnpdev, c
* Get resources from PnP layer.
*/
io = pnp_port_start(pnpdev, 0);
- irq = pnp_irq(pnpdev, 0);
+ irq = pnp_irq_start(pnpdev, 0);
if (pnp_dma_valid(pnpdev, 0))
- dma = pnp_dma(pnpdev, 0);
+ dma = pnp_dma_start(pnpdev, 0);
else
dma = -1;

Index: linux-2.6.24-rc2/drivers/net/3c509.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/3c509.c
+++ linux-2.6.24-rc2/drivers/net/3c509.c
@@ -409,7 +409,7 @@ __again:
pnp_device_detach(idev);
return -EBUSY;
}
- irq = pnp_irq(idev, 0);
+ irq = pnp_irq_start(idev, 0);
if (el3_debug > 3)
printk ("ISAPnP reports %s at i/o 0x%x, irq %d\n",
(char*) el3_isapnp_adapters[i].driver_data, ioaddr, irq);
Index: linux-2.6.24-rc2/drivers/net/3c515.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/3c515.c
+++ linux-2.6.24-rc2/drivers/net/3c515.c
@@ -524,7 +524,7 @@ static struct net_device *corkscrew_scan
continue;
}
ioaddr = pnp_port_start(idev, 0);
- irq = pnp_irq(idev, 0);
+ irq = pnp_irq_start(idev, 0);
if (!check_device(ioaddr)) {
pnp_device_detach(idev);
continue;
@@ -572,7 +572,7 @@ static int corkscrew_setup(struct net_de
DECLARE_MAC_BUF(mac);

if (idev) {
- irq = pnp_irq(idev, 0);
+ irq = pnp_irq_start(idev, 0);
vp->dev = &idev->dev;
} else {
irq = inw(ioaddr + 0x2002) & 15;
Index: linux-2.6.24-rc2/drivers/net/irda/nsc-ircc.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/irda/nsc-ircc.c
+++ linux-2.6.24-rc2/drivers/net/irda/nsc-ircc.c
@@ -934,11 +934,11 @@ static int nsc_ircc_pnp_probe(struct pnp

if (pnp_irq_valid(dev, 0) &&
!(pnp_irq_flags(dev, 0) & IORESOURCE_DISABLED))
- pnp_info.irq = pnp_irq(dev, 0);
+ pnp_info.irq = pnp_irq_start(dev, 0);

if (pnp_dma_valid(dev, 0) &&
!(pnp_dma_flags(dev, 0) & IORESOURCE_DISABLED))
- pnp_info.dma = pnp_dma(dev, 0);
+ pnp_info.dma = pnp_dma_start(dev, 0);

IRDA_DEBUG(0, "%s() : From PnP, found firbase 0x%03X ; irq %d ; dma %d.\n",
__FUNCTION__, pnp_info.fir_base, pnp_info.irq, pnp_info.dma);
Index: linux-2.6.24-rc2/drivers/net/irda/smsc-ircc2.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/irda/smsc-ircc2.c
+++ linux-2.6.24-rc2/drivers/net/irda/smsc-ircc2.c
@@ -388,8 +388,8 @@ static int __init smsc_ircc_pnp_probe(st

sirbase = pnp_port_start(dev, 0);
firbase = pnp_port_start(dev, 1);
- dma = pnp_dma(dev, 0);
- irq = pnp_irq(dev, 0);
+ dma = pnp_dma_start(dev, 0);
+ irq = pnp_irq_start(dev, 0);

if (smsc_ircc_open(firbase, sirbase, dma, irq))
return -ENODEV;
Index: linux-2.6.24-rc2/drivers/net/ne.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/ne.c
+++ linux-2.6.24-rc2/drivers/net/ne.c
@@ -261,7 +261,7 @@ static int __init ne_probe_isapnp(struct
}
/* found it */
dev->base_addr = pnp_port_start(idev, 0);
- dev->irq = pnp_irq(idev, 0);
+ dev->irq = pnp_irq_start(idev, 0);
printk(KERN_INFO "ne.c: ISAPnP reports %s at i/o %#lx, irq %d.\n",
(char *) isapnp_clone_list[i].driver_data,
dev->base_addr, dev->irq);
Index: linux-2.6.24-rc2/drivers/net/sb1000.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/sb1000.c
+++ linux-2.6.24-rc2/drivers/net/sb1000.c
@@ -157,7 +157,7 @@ sb1000_probe_one(struct pnp_dev *pdev, c
ioaddr[0] = pnp_port_start(pdev, 0);
ioaddr[1] = pnp_port_start(pdev, 0);

- irq = pnp_irq(pdev, 0);
+ irq = pnp_irq_start(pdev, 0);

if (!request_region(ioaddr[0], 16, "sb1000"))
goto out_disable;
Index: linux-2.6.24-rc2/drivers/net/smc-ultra.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/net/smc-ultra.c
+++ linux-2.6.24-rc2/drivers/net/smc-ultra.c
@@ -342,7 +342,7 @@ static int __init ultra_probe_isapnp(str
goto __again;
/* found it */
dev->base_addr = pnp_port_start(idev, 0);
- dev->irq = pnp_irq(idev, 0);
+ dev->irq = pnp_irq_start(idev, 0);
printk(KERN_INFO "smc-ultra.c: ISAPnP reports %s at i/o %#lx, irq %d.\n",
(char *) ultra_device_ids[i].driver_data,
dev->base_addr, dev->irq);
Index: linux-2.6.24-rc2/drivers/parport/parport_pc.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/parport/parport_pc.c
+++ linux-2.6.24-rc2/drivers/parport/parport_pc.c
@@ -3077,13 +3077,13 @@ static int parport_pc_pnp_probe(struct p

if (pnp_irq_valid(dev,0) &&
!(pnp_irq_flags(dev,0) & IORESOURCE_DISABLED)) {
- irq = pnp_irq(dev,0);
+ irq = pnp_irq_start(dev,0);
} else
irq = PARPORT_IRQ_NONE;

if (pnp_dma_valid(dev,0) &&
!(pnp_dma_flags(dev,0) & IORESOURCE_DISABLED)) {
- dma = pnp_dma(dev,0);
+ dma = pnp_dma_start(dev,0);
} else
dma = PARPORT_DMA_NONE;

Index: linux-2.6.24-rc2/drivers/scsi/aha152x.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/scsi/aha152x.c
+++ linux-2.6.24-rc2/drivers/scsi/aha152x.c
@@ -3800,7 +3800,7 @@ static int __init aha152x_init(void)
}

setup[setup_count].io_port = pnp_port_start(dev, 0);
- setup[setup_count].irq = pnp_irq(dev, 0);
+ setup[setup_count].irq = pnp_irq_start(dev, 0);
setup[setup_count].scsiid = 7;
setup[setup_count].reconnect = 1;
setup[setup_count].parity = 1;
Index: linux-2.6.24-rc2/drivers/scsi/g_NCR5380.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/scsi/g_NCR5380.c
+++ linux-2.6.24-rc2/drivers/scsi/g_NCR5380.c
@@ -337,11 +337,11 @@ int __init generic_NCR5380_detect(struct
continue;
}
if (pnp_irq_valid(dev, 0))
- overrides[count].irq = pnp_irq(dev, 0);
+ overrides[count].irq = pnp_irq_start(dev, 0);
else
overrides[count].irq = SCSI_IRQ_NONE;
if (pnp_dma_valid(dev, 0))
- overrides[count].dma = pnp_dma(dev, 0);
+ overrides[count].dma = pnp_dma_start(dev, 0);
else
overrides[count].dma = DMA_NONE;
overrides[count].NCR5380_map_name = (NCR5380_map_type) pnp_port_start(dev, 0);
Index: linux-2.6.24-rc2/drivers/scsi/sym53c416.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/scsi/sym53c416.c
+++ linux-2.6.24-rc2/drivers/scsi/sym53c416.c
@@ -669,7 +669,7 @@ int __init sym53c416_detect(struct scsi_

i[0] = 2;
i[1] = pnp_port_start(idev, 0);
- i[2] = pnp_irq(idev, 0);
+ i[2] = pnp_irq_start(idev, 0);

printk(KERN_INFO "sym53c416: ISAPnP card found and configured at 0x%X, IRQ %d.\n",
i[1], i[2]);
Index: linux-2.6.24-rc2/sound/drivers/mpu401/mpu401.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/drivers/mpu401/mpu401.c
+++ linux-2.6.24-rc2/sound/drivers/mpu401/mpu401.c
@@ -178,7 +178,7 @@ static int __devinit snd_mpu401_pnp(int
snd_printk(KERN_WARNING "no PnP irq, using polling\n");
irq[dev] = -1;
} else {
- irq[dev] = pnp_irq(device, 0);
+ irq[dev] = pnp_irq_start(device, 0);
}
return 0;
}
Index: linux-2.6.24-rc2/sound/isa/ad1816a/ad1816a.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/ad1816a/ad1816a.c
+++ linux-2.6.24-rc2/sound/isa/ad1816a/ad1816a.c
@@ -158,9 +158,9 @@ static int __devinit snd_card_ad1816a_pn

port[dev] = pnp_port_start(pdev, 2);
fm_port[dev] = pnp_port_start(pdev, 1);
- dma1[dev] = pnp_dma(pdev, 0);
- dma2[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);

if (acard->devmpu == NULL) {
kfree(cfg);
@@ -183,7 +183,7 @@ static int __devinit snd_card_ad1816a_pn
acard->devmpu = NULL;
} else {
mpu_port[dev] = pnp_port_start(pdev, 0);
- mpu_irq[dev] = pnp_irq(pdev, 0);
+ mpu_irq[dev] = pnp_irq_start(pdev, 0);
}

kfree(cfg);
Index: linux-2.6.24-rc2/sound/isa/als100.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/als100.c
+++ linux-2.6.24-rc2/sound/isa/als100.c
@@ -146,9 +146,9 @@ static int __devinit snd_card_als100_pnp
return err;
}
port[dev] = pnp_port_start(pdev, 0);
- dma8[dev] = pnp_dma(pdev, 1);
- dma16[dev] = pnp_dma(pdev, 0);
- irq[dev] = pnp_irq(pdev, 0);
+ dma8[dev] = pnp_dma_start(pdev, 1);
+ dma16[dev] = pnp_dma_start(pdev, 0);
+ irq[dev] = pnp_irq_start(pdev, 0);

pdev = acard->devmpu;
if (pdev != NULL) {
@@ -163,7 +163,7 @@ static int __devinit snd_card_als100_pnp
if (err < 0)
goto __mpu_error;
mpu_port[dev] = pnp_port_start(pdev, 0);
- mpu_irq[dev] = pnp_irq(pdev, 0);
+ mpu_irq[dev] = pnp_irq_start(pdev, 0);
} else {
__mpu_error:
if (pdev) {
Index: linux-2.6.24-rc2/sound/isa/azt2320.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/azt2320.c
+++ linux-2.6.24-rc2/sound/isa/azt2320.c
@@ -163,9 +163,9 @@ static int __devinit snd_card_azt2320_pn
port[dev] = pnp_port_start(pdev, 0);
fm_port[dev] = pnp_port_start(pdev, 1);
wss_port[dev] = pnp_port_start(pdev, 2);
- dma1[dev] = pnp_dma(pdev, 0);
- dma2[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);

pdev = acard->devmpu;
if (pdev != NULL) {
@@ -180,7 +180,7 @@ static int __devinit snd_card_azt2320_pn
if (err < 0)
goto __mpu_error;
mpu_port[dev] = pnp_port_start(pdev, 0);
- mpu_irq[dev] = pnp_irq(pdev, 0);
+ mpu_irq[dev] = pnp_irq_start(pdev, 0);
} else {
__mpu_error:
if (pdev) {
Index: linux-2.6.24-rc2/sound/isa/cmi8330.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/cmi8330.c
+++ linux-2.6.24-rc2/sound/isa/cmi8330.c
@@ -322,8 +322,8 @@ static int __devinit snd_cmi8330_pnp(int
return -EBUSY;
}
wssport[dev] = pnp_port_start(pdev, 0);
- wssdma[dev] = pnp_dma(pdev, 0);
- wssirq[dev] = pnp_irq(pdev, 0);
+ wssdma[dev] = pnp_dma_start(pdev, 0);
+ wssirq[dev] = pnp_irq_start(pdev, 0);

/* allocate SB16 resources */
pdev = acard->play;
@@ -347,9 +347,9 @@ static int __devinit snd_cmi8330_pnp(int
return -EBUSY;
}
sbport[dev] = pnp_port_start(pdev, 0);
- sbdma8[dev] = pnp_dma(pdev, 0);
- sbdma16[dev] = pnp_dma(pdev, 1);
- sbirq[dev] = pnp_irq(pdev, 0);
+ sbdma8[dev] = pnp_dma_start(pdev, 0);
+ sbdma16[dev] = pnp_dma_start(pdev, 1);
+ sbirq[dev] = pnp_irq_start(pdev, 0);

kfree(cfg);
return 0;
Index: linux-2.6.24-rc2/sound/isa/cs423x/cs4236.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/cs423x/cs4236.c
+++ linux-2.6.24-rc2/sound/isa/cs423x/cs4236.c
@@ -300,9 +300,10 @@ static int __devinit snd_cs423x_pnp_init
if (fm_port[dev] > 0)
fm_port[dev] = pnp_port_start(pdev, 1);
sb_port[dev] = pnp_port_start(pdev, 2);
- irq[dev] = pnp_irq(pdev, 0);
- dma1[dev] = pnp_dma(pdev, 0);
- dma2[dev] = pnp_dma(pdev, 1) == 4 ? -1 : (int)pnp_dma(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1) == 4 ? -1 :
+ (int)pnp_dma_start(pdev, 1);
snd_printdd("isapnp WSS: wss port=0x%lx, fm port=0x%lx, sb port=0x%lx\n",
port[dev], fm_port[dev], sb_port[dev]);
snd_printdd("isapnp WSS: irq=%i, dma1=%i, dma2=%i\n",
@@ -354,8 +355,8 @@ static int __devinit snd_cs423x_pnp_init
} else {
mpu_port[dev] = pnp_port_start(pdev, 0);
if (mpu_irq[dev] >= 0 &&
- pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
- mpu_irq[dev] = pnp_irq(pdev, 0);
+ pnp_irq_valid(pdev, 0) && pnp_irq_start(pdev, 0) >= 0) {
+ mpu_irq[dev] = pnp_irq_start(pdev, 0);
} else {
mpu_irq[dev] = -1; /* disable interrupt */
}
Index: linux-2.6.24-rc2/sound/isa/dt019x.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/dt019x.c
+++ linux-2.6.24-rc2/sound/isa/dt019x.c
@@ -129,8 +129,8 @@ static int __devinit snd_card_dt019x_pnp
}

port[dev] = pnp_port_start(pdev, 0);
- dma8[dev] = pnp_dma(pdev, 0);
- irq[dev] = pnp_irq(pdev, 0);
+ dma8[dev] = pnp_dma_start(pdev, 0);
+ irq[dev] = pnp_irq_start(pdev, 0);
snd_printdd("dt019x: found audio interface: port=0x%lx, irq=0x%x, dma=0x%x\n",
port[dev],irq[dev],dma8[dev]);

@@ -151,7 +151,7 @@ static int __devinit snd_card_dt019x_pnp
goto __mpu_error;
}
mpu_port[dev] = pnp_port_start(pdev, 0);
- mpu_irq[dev] = pnp_irq(pdev, 0);
+ mpu_irq[dev] = pnp_irq_start(pdev, 0);
snd_printdd("dt019x: found MPU-401: port=0x%lx, irq=0x%x\n",
mpu_port[dev],mpu_irq[dev]);
} else {
Index: linux-2.6.24-rc2/sound/isa/es18xx.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/es18xx.c
+++ linux-2.6.24-rc2/sound/isa/es18xx.c
@@ -2067,18 +2067,18 @@ static int __devinit snd_audiodrive_pnp_
/* skip csn and logdev initialization - already done in isapnp_configure */
if (pnp_device_is_isapnp(pdev)) {
isapnp_cfg_begin(isapnp_card_number(pdev), isapnp_csn_number(pdev));
- isapnp_write_byte(0x27, pnp_irq(pdev, 0)); /* Hardware Volume IRQ Number */
+ isapnp_write_byte(0x27, pnp_irq_start(pdev, 0)); /* Hardware Volume IRQ Number */
if (mpu_port[dev] != SNDRV_AUTO_PORT)
- isapnp_write_byte(0x28, pnp_irq(pdev, 0)); /* MPU-401 IRQ Number */
- isapnp_write_byte(0x72, pnp_irq(pdev, 0)); /* second IRQ */
+ isapnp_write_byte(0x28, pnp_irq_start(pdev, 0)); /* MPU-401 IRQ Number */
+ isapnp_write_byte(0x72, pnp_irq_start(pdev, 0)); /* second IRQ */
isapnp_cfg_end();
}
port[dev] = pnp_port_start(pdev, 0);
fm_port[dev] = pnp_port_start(pdev, 1);
mpu_port[dev] = pnp_port_start(pdev, 2);
- dma1[dev] = pnp_dma(pdev, 0);
- dma2[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);
snd_printdd("PnP ES18xx: port=0x%lx, fm port=0x%lx, mpu port=0x%lx\n", port[dev], fm_port[dev], mpu_port[dev]);
snd_printdd("PnP ES18xx: dma1=%i, dma2=%i, irq=%i\n", dma1[dev], dma2[dev], irq[dev]);
return 0;
Index: linux-2.6.24-rc2/sound/isa/gus/interwave.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/gus/interwave.c
+++ linux-2.6.24-rc2/sound/isa/gus/interwave.c
@@ -608,10 +608,10 @@ static int __devinit snd_interwave_pnp(i
return -ENOENT;
}
port[dev] = pnp_port_start(pdev, 0);
- dma1[dev] = pnp_dma(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
if (dma2[dev] >= 0)
- dma2[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);
snd_printdd("isapnp IW: sb port=0x%llx, gf1 port=0x%llx, codec port=0x%llx\n",
(unsigned long long)pnp_port_start(pdev, 0),
(unsigned long long)pnp_port_start(pdev, 1),
Index: linux-2.6.24-rc2/sound/isa/opl3sa2.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/opl3sa2.c
+++ linux-2.6.24-rc2/sound/isa/opl3sa2.c
@@ -650,9 +650,9 @@ static int __devinit snd_opl3sa2_pnp(int
fm_port[dev] = pnp_port_start(pdev, 2);
midi_port[dev] = pnp_port_start(pdev, 3);
port[dev] = pnp_port_start(pdev, 4);
- dma1[dev] = pnp_dma(pdev, 0);
- dma2[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);
snd_printdd("%sPnP OPL3-SA: sb port=0x%lx, wss port=0x%lx, fm port=0x%lx, midi port=0x%lx\n",
pnp_device_is_pnpbios(pdev) ? "BIOS" : "ISA", sb_port[dev], wss_port[dev], fm_port[dev], midi_port[dev]);
snd_printdd("%sPnP OPL3-SA: control port=0x%lx, dma1=%i, dma2=%i, irq=%i\n",
Index: linux-2.6.24-rc2/sound/isa/opti9xx/opti92x-ad1848.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/opti9xx/opti92x-ad1848.c
+++ linux-2.6.24-rc2/sound/isa/opti9xx/opti92x-ad1848.c
@@ -1748,10 +1748,10 @@ static int __devinit snd_card_opti9xx_pn
port = pnp_port_start(pdev, 1);
fm_port = pnp_port_start(pdev, 2) + 8;
#endif /* OPTi93X */
- irq = pnp_irq(pdev, 0);
- dma1 = pnp_dma(pdev, 0);
+ irq = pnp_irq_start(pdev, 0);
+ dma1 = pnp_dma_start(pdev, 0);
#if defined(CS4231) || defined(OPTi93X)
- dma2 = pnp_dma(pdev, 1);
+ dma2 = pnp_dma_start(pdev, 1);
#endif /* CS4231 || OPTi93X */

pdev = chip->devmpu;
@@ -1772,7 +1772,7 @@ static int __devinit snd_card_opti9xx_pn
chip->devmpu = NULL;
} else {
mpu_port = pnp_port_start(pdev, 0);
- mpu_irq = pnp_irq(pdev, 0);
+ mpu_irq = pnp_irq_start(pdev, 0);
}
}
kfree(cfg);
Index: linux-2.6.24-rc2/sound/isa/sb/es968.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/sb/es968.c
+++ linux-2.6.24-rc2/sound/isa/sb/es968.c
@@ -116,8 +116,8 @@ static int __devinit snd_card_es968_pnp(
return err;
}
port[dev] = pnp_port_start(pdev, 0);
- dma8[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma8[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);

kfree(cfg);
return 0;
Index: linux-2.6.24-rc2/sound/isa/sb/sb16.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/sb/sb16.c
+++ linux-2.6.24-rc2/sound/isa/sb/sb16.c
@@ -300,9 +300,9 @@ static int __devinit snd_card_sb16_pnp(i
port[dev] = pnp_port_start(pdev, 0);
mpu_port[dev] = pnp_port_start(pdev, 1);
fm_port[dev] = pnp_port_start(pdev, 2);
- dma8[dev] = pnp_dma(pdev, 0);
- dma16[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
+ dma8[dev] = pnp_dma_start(pdev, 0);
+ dma16[dev] = pnp_dma_start(pdev, 1);
+ irq[dev] = pnp_irq_start(pdev, 0);
snd_printdd("pnp SB16: port=0x%lx, mpu port=0x%lx, fm port=0x%lx\n",
port[dev], mpu_port[dev], fm_port[dev]);
snd_printdd("pnp SB16: dma1=%i, dma2=%i, irq=%i\n",
Index: linux-2.6.24-rc2/sound/isa/wavefront/wavefront.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/wavefront/wavefront.c
+++ linux-2.6.24-rc2/sound/isa/wavefront/wavefront.c
@@ -187,9 +187,9 @@ snd_wavefront_pnp (int dev, snd_wavefron

cs4232_pcm_port[dev] = pnp_port_start(pdev, 0);
fm_port[dev] = pnp_port_start(pdev, 1);
- dma1[dev] = pnp_dma(pdev, 0);
- dma2[dev] = pnp_dma(pdev, 1);
- cs4232_pcm_irq[dev] = pnp_irq(pdev, 0);
+ dma1[dev] = pnp_dma_start(pdev, 0);
+ dma2[dev] = pnp_dma_start(pdev, 1);
+ cs4232_pcm_irq[dev] = pnp_irq_start(pdev, 0);

/* Synth initialization */

@@ -215,7 +215,7 @@ snd_wavefront_pnp (int dev, snd_wavefron
}

ics2115_port[dev] = pnp_port_start(pdev, 0);
- ics2115_irq[dev] = pnp_irq(pdev, 0);
+ ics2115_irq[dev] = pnp_irq_start(pdev, 0);

/* CS4232 MPU initialization. Configure this only if
explicitly requested, since its physically inaccessible and
@@ -241,7 +241,7 @@ snd_wavefront_pnp (int dev, snd_wavefron
cs4232_mpu_port[dev] = SNDRV_AUTO_PORT;
} else {
cs4232_mpu_port[dev] = pnp_port_start(pdev, 0);
- cs4232_mpu_irq[dev] = pnp_irq(pdev, 0);
+ cs4232_mpu_irq[dev] = pnp_irq_start(pdev, 0);
}

snd_printk (KERN_INFO "CS4232 MPU: port=0x%lx, irq=%i\n",
Index: linux-2.6.24-rc2/sound/oss/ad1848.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/oss/ad1848.c
+++ linux-2.6.24-rc2/sound/oss/ad1848.c
@@ -2910,10 +2910,10 @@ static struct pnp_dev __init *ad1848_ini
if((ad1848_dev = activate_dev(ad1848_isapnp_list[slot].name, "ad1848", ad1848_dev)))
{
hw_config->io_base = pnp_port_start(ad1848_dev, ad1848_isapnp_list[slot].mss_io);
- hw_config->irq = pnp_irq(ad1848_dev, ad1848_isapnp_list[slot].irq);
- hw_config->dma = pnp_dma(ad1848_dev, ad1848_isapnp_list[slot].dma);
+ hw_config->irq = pnp_irq_start(ad1848_dev, ad1848_isapnp_list[slot].irq);
+ hw_config->dma = pnp_dma_start(ad1848_dev, ad1848_isapnp_list[slot].dma);
if(ad1848_isapnp_list[slot].dma2 != -1)
- hw_config->dma2 = pnp_dma(ad1848_dev, ad1848_isapnp_list[slot].dma2);
+ hw_config->dma2 = pnp_dma_start(ad1848_dev, ad1848_isapnp_list[slot].dma2);
else
hw_config->dma2 = -1;
hw_config->card_subtype = ad1848_isapnp_list[slot].type;
Index: linux-2.6.24-rc2/sound/oss/sb_card.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/oss/sb_card.c
+++ linux-2.6.24-rc2/sound/oss/sb_card.c
@@ -178,58 +178,58 @@ static void sb_dev2cfg(struct pnp_dev *d
different logical devices for the MPU */
if(!strncmp("CTL",scc->card_id,3)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,0);
- scc->conf.dma2 = pnp_dma(dev,1);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,0);
+ scc->conf.dma2 = pnp_dma_start(dev,1);
scc->mpucnf.io_base = pnp_port_start(dev,1);
return;
}
if(!strncmp("tBA",scc->card_id,3)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,0);
- scc->conf.dma2 = pnp_dma(dev,1);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,0);
+ scc->conf.dma2 = pnp_dma_start(dev,1);
return;
}
if(!strncmp("ESS",scc->card_id,3)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,0);
- scc->conf.dma2 = pnp_dma(dev,1);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,0);
+ scc->conf.dma2 = pnp_dma_start(dev,1);
scc->mpucnf.io_base = pnp_port_start(dev,2);
return;
}
if(!strncmp("CMI",scc->card_id,3)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,0);
- scc->conf.dma2 = pnp_dma(dev,1);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,0);
+ scc->conf.dma2 = pnp_dma_start(dev,1);
return;
}
if(!strncmp("RWB",scc->card_id,3)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,0);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,0);
return;
}
if(!strncmp("ALS",scc->card_id,3)) {
if(!strncmp("ALS0007",scc->card_id,7)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,0);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,0);
} else {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,1);
- scc->conf.dma2 = pnp_dma(dev,0);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,1);
+ scc->conf.dma2 = pnp_dma_start(dev,0);
}
return;
}
if(!strncmp("RTL",scc->card_id,3)) {
scc->conf.io_base = pnp_port_start(dev,0);
- scc->conf.irq = pnp_irq(dev,0);
- scc->conf.dma = pnp_dma(dev,1);
- scc->conf.dma2 = pnp_dma(dev,0);
+ scc->conf.irq = pnp_irq_start(dev,0);
+ scc->conf.dma = pnp_dma_start(dev,1);
+ scc->conf.dma2 = pnp_dma_start(dev,0);
}
}

Index: linux-2.6.24-rc2/drivers/ide/ide-pnp.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/ide/ide-pnp.c
+++ linux-2.6.24-rc2/drivers/ide/ide-pnp.c
@@ -39,7 +39,7 @@ static int idepnp_probe(struct pnp_dev *
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, pnp_port_start(dev, 0),
pnp_port_start(dev, 1));
- hw.irq = pnp_irq(dev, 0);
+ hw.irq = pnp_irq_start(dev, 0);

index = ide_register_hw(&hw, NULL, 1, &hwif);

Index: linux-2.6.24-rc2/sound/isa/sscape.c
===================================================================
--- linux-2.6.24-rc2.orig/sound/isa/sscape.c
+++ linux-2.6.24-rc2/sound/isa/sscape.c
@@ -1479,15 +1479,15 @@ static int __devinit sscape_pnp_detect(s
* Read the correct parameters off the ISA PnP bus ...
*/
port[idx] = pnp_port_start(dev, 0);
- irq[idx] = pnp_irq(dev, 0);
- mpu_irq[idx] = pnp_irq(dev, 1);
- dma[idx] = pnp_dma(dev, 0) & 0x03;
+ irq[idx] = pnp_irq_start(dev, 0);
+ mpu_irq[idx] = pnp_irq_start(dev, 1);
+ dma[idx] = pnp_dma_start(dev, 0) & 0x03;
if (sscape->type == SSCAPE_PNP) {
dma2[idx] = dma[idx];
wss_port[idx] = CODEC_IO(port[idx]);
} else {
wss_port[idx] = pnp_port_start(dev, 1);
- dma2[idx] = pnp_dma(dev, 1);
+ dma2[idx] = pnp_dma_start(dev, 1);
}

ret = create_sscape(idx, card);
Index: linux-2.6.24-rc2/drivers/char/tpm/tpm_tis.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/char/tpm/tpm_tis.c
+++ linux-2.6.24-rc2/drivers/char/tpm/tpm_tis.c
@@ -600,7 +600,7 @@ static int __devinit tpm_tis_pnp_init(st
len = pnp_mem_len(pnp_dev, 0);

if (pnp_irq_valid(pnp_dev, 0))
- irq = pnp_irq(pnp_dev, 0);
+ irq = pnp_irq_start(pnp_dev, 0);
else
interrupts = 0;

Index: linux-2.6.24-rc2/drivers/serial/8250_pnp.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/serial/8250_pnp.c
+++ linux-2.6.24-rc2/drivers/serial/8250_pnp.c
@@ -440,7 +440,7 @@ serial_pnp_probe(struct pnp_dev *dev, co

memset(&port, 0, sizeof(struct uart_port));
if (pnp_irq_valid(dev, 0))
- port.irq = pnp_irq(dev, 0);
+ port.irq = pnp_irq_start(dev, 0);
if (pnp_port_valid(dev, 0)) {
port.iobase = pnp_port_start(dev, 0);
port.iotype = UPIO_PORT;



2007-11-20 10:22:10

by Rene Herman

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On 20-11-07 10:51, Thomas Renninger wrote:

> Unify the pnp macros to access resources in the pnp resource table
>
> port, mem, dma and irq resource macros are now all used in the same
> way. This is the basis (or makes it at least easier) for changing how
> the resources are allocated for memory optimizations.
>
> Signed-off-by: Thomas Renninger <[email protected]>

Acked-by: Rene Herman <[email protected]>

as identity transformation again.

Andrew Morton wrote:

> Normally when I get a big tree-wide patch like this I'll just drop the
> hunks which get rejects so that the patch doesn't screw up other people's
> trees if I merge first.
>
>
>> >
>> > Index: linux-2.6.24-rc2/include/linux/pnp.h
>> > ===================================================================
>> > --- linux-2.6.24-rc2.orig/include/linux/pnp.h
>> > +++ linux-2.6.24-rc2/include/linux/pnp.h
>> > @@ -55,7 +55,6 @@ struct pnp_dev;
>> > (pnp_mem_end((dev),(bar)) - \
>> > pnp_mem_start((dev),(bar)) + 1))
>> >
>> > -#define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].start)
>> > #define pnp_irq_start(dev,bar) ((dev)->res.irq_resource[(bar)].start)
>> > #define pnp_irq_end(dev,bar) ((dev)->res.irq_resource[(bar)].end)
>> > #define pnp_irq_flags(dev,bar) ((dev)->res.irq_resource[(bar)].flags)
>> > @@ -63,7 +62,6 @@ struct pnp_dev;
>> > ((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
>> > == IORESOURCE_IRQ)
>> >
>> > -#define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].start)
>
> But if I do that, we'll get build breakage.
>
> And we'll break any files which you missed in the conversion, or which
> people currently have queued in the subsystem trees, or which people are
> maintaining out-of-tree.
>
> Hence I'd suggest that we retain the above as back-compatibility wrappers
> for a while.

And Shaohua Li wrote:

> patches are great. I have a minor comment. Keep pnp_irq and pnp_dma and
> define them as pnp_irq_start and pnp_dma_start. pnp_irq_start and
> pnp_dma_start is a little confusing from a pnp driver point of view.

Rene.

2007-11-20 12:33:21

by Alan

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On Tue, 20 Nov 2007 10:51:23 +0100
Thomas Renninger <[email protected]> wrote:

> Unify the pnp macros to access resources in the pnp resource table

NAK

> port, mem, dma and irq resource macros are now all used in the same
> way. This is the basis (or makes it at least easier) for changing how
> the resources are allocated for memory optimizations.
>
> Signed-off-by: Thomas Renninger <[email protected]>

I really don't like this change.

_start implies an _end and an _len. IRQs have none of those features, nor
are they ranges.

Alan

2007-11-20 14:19:30

by Thomas Renninger

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On Tue, 2007-11-20 at 12:31 +0000, Alan Cox wrote:
> On Tue, 20 Nov 2007 10:51:23 +0100
> Thomas Renninger <[email protected]> wrote:
>
> > Unify the pnp macros to access resources in the pnp resource table
>
> NAK
>
> > port, mem, dma and irq resource macros are now all used in the same
> > way. This is the basis (or makes it at least easier) for changing how
> > the resources are allocated for memory optimizations.
> >
> > Signed-off-by: Thomas Renninger <[email protected]>
>
> I really don't like this change.
>
> _start implies an _end and an _len. IRQs have none of those features, nor
> are they ranges.

Ok.
To do this properly irq and dma should use their own structs in the pnp
resource table, IMO.
The struct resource with start, end, size and list pointers make only
sense for port and mem resources which are registered at
kernel/resource.c:insert_resource(..)

However, one useless exported symbol (why does this exist at all, have I
overseen something?) needs to get removed for that and I could imagine
this is making things worse as some externally built old drivers might
break?

At the end is some example code how things could get even more cleaned
up. It shows how I think pnp layer and one example driver would get
adjusted. There are not that much drivers making use of
pnp_resource_change..., but still (I am also not sure whether there is
more to adjust in drivers, but I expect the rest can be covered by the
macros...).

If this is not an option, please advise how to move on here:
Still use struct resources for dma and irq, but just do not name it
_start, but name the macro pnp_irq_no?

Thanks,

Thomas

---
drivers/pnp/manager.c | 15 --------------
include/linux/pnp.h | 19 +++++++++++-------
sound/isa/als100.c | 52 ++++++++++++++++++++++++++++++++++++--------------
3 files changed, 50 insertions(+), 36 deletions(-)

Index: linux-2.6.24-rc2_mm1/include/linux/pnp.h
===================================================================
--- linux-2.6.24-rc2_mm1.orig/include/linux/pnp.h
+++ linux-2.6.24-rc2_mm1/include/linux/pnp.h
@@ -55,13 +55,13 @@ struct pnp_dev;
(pnp_mem_end((dev),(bar)) - \
pnp_mem_start((dev),(bar)) + 1))

-#define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].start)
+#define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].no)
#define pnp_irq_flags(dev,bar) ((dev)->res.irq_resource[(bar)].flags)
#define pnp_irq_valid(dev,bar) \
((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
== IORESOURCE_IRQ)

-#define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].start)
+#define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].no)
#define pnp_dma_flags(dev,bar) ((dev)->res.dma_resource[(bar)].flags)
#define pnp_dma_valid(dev,bar) \
((pnp_dma_flags((dev),(bar)) & (IORESOURCE_DMA | IORESOURCE_UNSET)) \
@@ -118,11 +118,16 @@ struct pnp_option {
struct pnp_option *next; /* used to chain dependent resources */
};

+struct pnp_irq_dma_res {
+ unsigned no;
+ unsigned long flags;
+};
+
struct pnp_resource_table {
struct resource port_resource[PNP_MAX_PORT];
struct resource mem_resource[PNP_MAX_MEM];
- struct resource dma_resource[PNP_MAX_DMA];
- struct resource irq_resource[PNP_MAX_IRQ];
+ struct pnp_irq_dma_res dma_resource[PNP_MAX_DMA];
+ struct pnp_irq_dma_res irq_resource[PNP_MAX_IRQ];
};

/*
@@ -396,8 +401,8 @@ int pnp_start_dev(struct pnp_dev *dev);
int pnp_stop_dev(struct pnp_dev *dev);
int pnp_activate_dev(struct pnp_dev *dev);
int pnp_disable_dev(struct pnp_dev *dev);
-void pnp_resource_change(struct resource *resource, resource_size_t start,
- resource_size_t size);
+//void pnp_resource_change(struct resource *resource, resource_size_t start,
+// resource_size_t size);

/* protocol helpers */
int pnp_is_active(struct pnp_dev *dev);
@@ -444,7 +449,7 @@ static inline int pnp_start_dev(struct p
static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
-static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }
+//static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }

/* protocol helpers */
static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }
Index: linux-2.6.24-rc2_mm1/drivers/pnp/manager.c
===================================================================
--- linux-2.6.24-rc2_mm1.orig/drivers/pnp/manager.c
+++ linux-2.6.24-rc2_mm1/drivers/pnp/manager.c
@@ -560,24 +560,9 @@ int pnp_disable_dev(struct pnp_dev *dev)
return 0;
}

-/**
- * pnp_resource_change - change one resource
- * @resource: pointer to resource to be changed
- * @start: start of region
- * @size: size of region
- */
-void pnp_resource_change(struct resource *resource, resource_size_t start,
- resource_size_t size)
-{
- resource->flags &= ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
- resource->start = start;
- resource->end = start + size - 1;
-}
-
EXPORT_SYMBOL(pnp_manual_config_dev);
EXPORT_SYMBOL(pnp_start_dev);
EXPORT_SYMBOL(pnp_stop_dev);
EXPORT_SYMBOL(pnp_activate_dev);
EXPORT_SYMBOL(pnp_disable_dev);
-EXPORT_SYMBOL(pnp_resource_change);
EXPORT_SYMBOL(pnp_init_resource_table);
Index: linux-2.6.24-rc2_mm1/sound/isa/als100.c
===================================================================
--- linux-2.6.24-rc2_mm1.orig/sound/isa/als100.c
+++ linux-2.6.24-rc2_mm1/sound/isa/als100.c
@@ -129,14 +129,27 @@ static int __devinit snd_card_als100_pnp
pnp_init_resource_table(cfg);

/* override resources */
- if (port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[0], port[dev], 16);
- if (dma8[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[0], dma8[dev], 1);
- if (dma16[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[1], dma16[dev], 1);
- if (irq[dev] != SNDRV_AUTO_IRQ)
- pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
+ if (port[dev] != SNDRV_AUTO_PORT) {
+ cfg->port_resource[0].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->port_resource[0].start = port[dev];
+ cfg->port_resource[0].end = port[dev] + 16 - 1;
+ }
+ if (dma8[dev] != SNDRV_AUTO_DMA) {
+ cfg->dma_resource[0].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->dma_resource[0].no = dma8[dev];
+ }
+ if (dma16[dev] != SNDRV_AUTO_DMA) {
+ cfg->dma_resource[1].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->dma_resource[1].no = dma16[dev];
+ }
+ if (irq[dev] != SNDRV_AUTO_IRQ) {
+ cfg->irq_resource[0].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->irq_resource[0].no = irq[dev];
+ }
if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev);
@@ -153,10 +166,17 @@ static int __devinit snd_card_als100_pnp
pdev = acard->devmpu;
if (pdev != NULL) {
pnp_init_resource_table(cfg);
- if (mpu_port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[0], mpu_port[dev], 2);
- if (mpu_irq[dev] != SNDRV_AUTO_IRQ)
- pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
+ if (mpu_port[dev] != SNDRV_AUTO_PORT) {
+ cfg->port_resource[0].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->port_resource[0].start = mpu_port[dev];
+ cfg->port_resource[0].end = mpu_port[dev] + 2 - 1;
+ }
+ if (mpu_irq[dev] != SNDRV_AUTO_IRQ) {
+ cfg->irq_resource[0].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->irq_resource[0].no = mpu_irq[dev];
+ }
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
snd_printk(KERN_ERR PFX "MPU401 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev);
@@ -177,8 +197,12 @@ static int __devinit snd_card_als100_pnp
pdev = acard->devopl;
if (pdev != NULL) {
pnp_init_resource_table(cfg);
- if (fm_port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[0], fm_port[dev], 4);
+ if (fm_port[dev] != SNDRV_AUTO_PORT) {
+ cfg->port_resource[0].flags &=
+ ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
+ cfg->port_resource[0].start = fm_port[dev];
+ cfg->port_resource[0].end = fm_port[dev] + 4 - 1;
+ }
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
snd_printk(KERN_ERR PFX "OPL3 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev);


2007-11-20 14:36:36

by Rene Herman

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On 20-11-07 15:19, Thomas Renninger wrote:

> At the end is some example code how things could get even more cleaned
> up. It shows how I think pnp layer and one example driver would get
> adjusted. There are not that much drivers making use of
> pnp_resource_change...

The ALSA ISA-PnP drivers do in what I personally consider a bad layering
violation. Brought up not doing that a while ago on alsa-devel, but no
discussion ensued. If the PnP maintainer(s) agree with me though, I'd be
more than happy to rip all of that out of ALSA.

(added alsa-devel)

Rene.

2007-11-20 15:16:20

by Alan

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

> At the end is some example code how things could get even more cleaned
> up. It shows how I think pnp layer and one example driver would get

Your example adds rather than removes code.

> If this is not an option, please advise how to move on here:
> Still use struct resources for dma and irq, but just do not name it
> _start, but name the macro pnp_irq_no?

Is it actually even worth changing in the first place ? You seem to be
complicating the code not simplyifying it, and at the end of the day
ISAPnP is obsolete and BIOS PnP is obsoleted by ACPI

Alan

2007-11-20 16:48:17

by Thomas Renninger

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On Tue, 2007-11-20 at 15:31 +0100, Rene Herman wrote:
> On 20-11-07 15:19, Thomas Renninger wrote:
>
> > At the end is some example code how things could get even more cleaned
> > up. It shows how I think pnp layer and one example driver would get
> > adjusted. There are not that much drivers making use of
> > pnp_resource_change...
>
> The ALSA ISA-PnP drivers do in what I personally consider a bad layering
> violation. Brought up not doing that a while ago on alsa-devel, but no
> discussion ensued. If the PnP maintainer(s) agree with me though, I'd be
> more than happy to rip all of that out of ALSA.
>
> (added alsa-devel)

The pnp_resource_change is really ugly..., these are making use of it:
sound/isa/sb/es968.c
sound/isa/sb/sb16.c
sound/isa/gus/interwave.c
sound/isa/es18xx.c
sound/isa/cs423x/cs4236.c
sound/isa/wavefront/wavefront.c
sound/isa/ad1816a/ad1816a.c
sound/isa/cmi8330.c
sound/isa/opl3sa2.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/isa/als100.c
sound/isa/azt2320.c
sound/isa/dt019x.c


Thomas

2007-11-20 18:59:38

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

Alan Cox <[email protected]> writes:
>
> Is it actually even worth changing in the first place ? You seem to be
> complicating the code not simplyifying it, and at the end of the day
> ISAPnP is obsolete and BIOS PnP is obsoleted by ACPI

The PNP interface is used by the ACPI code to tell the various
non PCI drivers about their resources. Thomas is actually
aiming at some ACPI issues with this.

-Andi

2007-11-21 10:28:25

by Takashi Iwai

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

At Tue, 20 Nov 2007 15:31:26 +0100,
Rene Herman wrote:
>
> On 20-11-07 15:19, Thomas Renninger wrote:
>
> > At the end is some example code how things could get even more cleaned
> > up. It shows how I think pnp layer and one example driver would get
> > adjusted. There are not that much drivers making use of
> > pnp_resource_change...
>
> The ALSA ISA-PnP drivers do in what I personally consider a bad layering
> violation. Brought up not doing that a while ago on alsa-devel, but no
> discussion ensued. If the PnP maintainer(s) agree with me though, I'd be
> more than happy to rip all of that out of ALSA.

I'm fine with removal of that stuff now. It was implemented in that
way because there was no proper way to re-assign ISA PnP resources on
2.4 kernel time. On 2.6, it makes no longer any sense (except for
compatibility, but this is almost no problem for PnP boards).


thanks,

Takashi

2007-11-27 16:35:07

by Thomas Renninger

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On Wed, 2007-11-21 at 10:53 +0100, Takashi Iwai wrote:
> At Tue, 20 Nov 2007 15:31:26 +0100,
> Rene Herman wrote:
> >
> > On 20-11-07 15:19, Thomas Renninger wrote:
> >
> > > At the end is some example code how things could get even more cleaned
> > > up. It shows how I think pnp layer and one example driver would get
> > > adjusted. There are not that much drivers making use of
> > > pnp_resource_change...
> >
> > The ALSA ISA-PnP drivers do in what I personally consider a bad layering
> > violation. Brought up not doing that a while ago on alsa-devel, but no
> > discussion ensued. If the PnP maintainer(s) agree with me though, I'd be
> > more than happy to rip all of that out of ALSA.
Rene: Could you do that, pls.
>
> I'm fine with removal of that stuff now. It was implemented in that
> way because there was no proper way to re-assign ISA PnP resources on
> 2.4 kernel time. On 2.6, it makes no longer any sense (except for
> compatibility, but this is almost no problem for PnP boards).

I wasted some time on thinking about how this pnp_resource_change and
pnp_manual_config_dev could get workarounded..., but it's impossible
without changing the (more a workaround than an) interface.

If you worked on this already, would you mind ripping these out?

If I understand Takashi correctly, the driver code using
pnp_resource_change and pnp_manual_config_dev can simply be removed and
devices could get resources assigned via sysfs "set" interface.

Thanks,

Thomas

2007-11-27 16:52:32

by Rene Herman

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH 2/3] PNP cleanups - Unify the pnp macros to access resources in the pnp resource table

On 27-11-07 17:34, Thomas Renninger wrote:

> On Wed, 2007-11-21 at 10:53 +0100, Takashi Iwai wrote:
>> At Tue, 20 Nov 2007 15:31:26 +0100, Rene Herman wrote:
>>> On 20-11-07 15:19, Thomas Renninger wrote:
>>>
>>>> At the end is some example code how things could get even more
>>>> cleaned up. It shows how I think pnp layer and one example driver
>>>> would get adjusted. There are not that much drivers making use of
>>>> pnp_resource_change...
>>>
>>> The ALSA ISA-PnP drivers do in what I personally consider a bad
>>> layering violation. Brought up not doing that a while ago on
>>> alsa-devel, but no discussion ensued. If the PnP maintainer(s) agree
>>> with me though, I'd be more than happy to rip all of that out of
>>> ALSA.
>
> Rene: Could you do that, pls.

Yes, I will do this, In fact, I've done a few already but ofcourse a few
other things intervened again...

>> I'm fine with removal of that stuff now. It was implemented in that
>> way because there was no proper way to re-assign ISA PnP resources on
>> 2.4 kernel time. On 2.6, it makes no longer any sense (except for
>> compatibility, but this is almost no problem for PnP boards).
>
> I wasted some time on thinking about how this pnp_resource_change and
> pnp_manual_config_dev could get workarounded..., but it's impossible
> without changing the (more a workaround than an) interface.
>
> If you worked on this already, would you mind ripping these out?
>
> If I understand Takashi correctly, the driver code using
> pnp_resource_change and pnp_manual_config_dev can simply be removed and
> devices could get resources assigned via sysfs "set" interface.

Exactly. ISA-PnP is with respect to the interface it provides exactly as PCI
and other sane busses. You just ask the system what resources to use -- it
provides a method for actually changing them as well, but doing so belongs
isolated in the PnP layer, not anywhere else IMHYUO (*).

Wasn't aware of the original reason for this setup, but yes, in 2.6 it
certainly isn't needed for anything anymore and in fact just makes for
inconsistency, especially for the mixed legacy/isapnp drivers where module
parameters change meaning from "this is where it's at to "_put_ it there"
between the two card types.

Jaroslav Kysela will have to ack any patches as well, but sound/isa is the
only user of

- pnp_init_resource_table()
- pnp_resource_change()
- pnp_manual_config_dev()

which eventually then might also want to be unexported and/or deleted.

Rene.

(*) In My Humble Yet Unwavering Opinion...