Commit c6387a48 authored by David S. Miller's avatar David S. Miller
Browse files

[SPARC]: Kill __irq_itoa().



This ugly hack was long overdue to die.

It was a way to print out Sparc interrupts in a more freindly format,
since IRQ numbers were arbitrary opaque 32-bit integers which vectored
into PIL levels.  These 32-bit integers were not necessarily in the
0-->NR_IRQS range, but the PILs they vectored to were.

The idea now is that we will increase NR_IRQS a little bit and use a
virtual<-->real IRQ number mapping scheme similar to PowerPC.

That makes this IRQ printing hack irrelevant, and furthermore only a
handful of drivers actually used __irq_itoa() making it even less
useful.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a76267f
......@@ -896,13 +896,6 @@ static inline unsigned long get_irqmask(int irq_nr)
return 1 << irq_nr;
}
static inline char *pcic_irq_itoa(unsigned int irq)
{
static char buff[16];
sprintf(buff, "%d", irq);
return buff;
}
static void pcic_disable_irq(unsigned int irq_nr)
{
unsigned long mask, flags;
......@@ -955,7 +948,6 @@ void __init sun4m_pci_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, pcic_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, pcic_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, pcic_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, pcic_irq_itoa, BTFIXUPCALL_NORM);
}
int pcibios_assign_resource(struct pci_dev *pdev, int resource)
......
......@@ -163,7 +163,6 @@ EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
#endif
EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq));
EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq));
EXPORT_SYMBOL(BTFIXUP_CALL(__irq_itoa));
EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
......
......@@ -198,8 +198,6 @@ static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
static void sun4c_nop(void) {}
#endif
extern char *sun4m_irq_itoa(unsigned int irq);
void __init sun4c_init_IRQ(void)
{
struct linux_prom_registers int_regs[2];
......@@ -238,7 +236,6 @@ void __init sun4c_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, sun4c_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4c_clear_profile_irq, BTFIXUPCALL_NOP);
BTFIXUPSET_CALL(load_profile_irq, sun4c_load_profile_irq, BTFIXUPCALL_NOP);
BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4c_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4c_nop, BTFIXUPCALL_NOP);
......
......@@ -560,17 +560,6 @@ void __init sun4d_init_sbi_irq(void)
}
}
static char *sun4d_irq_itoa(unsigned int irq)
{
static char buff[16];
if (irq < (1 << 5))
sprintf(buff, "%d", irq);
else
sprintf(buff, "%d,%x", sbus_to_pil[(irq >> 2) & 7], irq);
return buff;
}
void __init sun4d_init_IRQ(void)
{
local_irq_disable();
......@@ -581,7 +570,6 @@ void __init sun4d_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4d_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);
......
......@@ -229,13 +229,6 @@ static void sun4m_load_profile_irq(int cpu, unsigned int limit)
sun4m_timers->cpu_timers[cpu].l14_timer_limit = limit;
}
char *sun4m_irq_itoa(unsigned int irq)
{
static char buff[16];
sprintf(buff, "%d", irq);
return buff;
}
static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
{
int reg_count, irq, cpu;
......@@ -388,7 +381,6 @@ void __init sun4m_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, sun4m_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4m_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4m_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4m_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4m_send_ipi, BTFIXUPCALL_NORM);
......
......@@ -167,13 +167,9 @@ fore200e_atm2fore_aal(int aal)
static char*
fore200e_irq_itoa(int irq)
{
#if defined(__sparc_v9__)
return __irq_itoa(irq);
#else
static char str[8];
sprintf(str, "%d", irq);
return str;
#endif
}
......
......@@ -960,10 +960,6 @@ static int __init rtc_init(void)
* PCI Slot 2 INTA# (and some INTx# in Slot 1).
*/
if (request_irq(rtc_irq, rtc_interrupt, SA_SHIRQ, "rtc", (void *)&rtc_port)) {
/*
* Standard way for sparc to print irq's is to use
* __irq_itoa(). I think for EBus it's ok to use %d.
*/
printk(KERN_ERR "rtc: cannot register IRQ %d\n", rtc_irq);
return -EIO;
}
......
......@@ -643,7 +643,7 @@ static inline void soc_init(struct sbus_dev *sdev, int no)
return;
}
SOD(("SOC uses IRQ%s\n", __irq_itoa(irq)))
SOD(("SOC uses IRQ %d\n", irq))
s->port[0].fc.irq = irq;
s->port[1].fc.irq = irq;
......
......@@ -767,7 +767,7 @@ static inline void socal_init(struct sbus_dev *sdev, int no)
return;
}
SOD(("SOCAL uses IRQ %s\n", __irq_itoa(irq)))
SOD(("SOCAL uses IRQ %d\n", irq))
s->port[0].fc.irq = irq;
s->port[1].fc.irq = irq;
......
......@@ -1138,16 +1138,11 @@ static int init_irq (ide_hwif_t *hwif)
spin_unlock_irq(&ide_lock);
}
#if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__)
#if !defined(__mc68000__) && !defined(CONFIG_APUS)
printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name,
hwif->io_ports[IDE_DATA_OFFSET],
hwif->io_ports[IDE_DATA_OFFSET]+7,
hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq);
#elif defined(__sparc__)
printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", hwif->name,
hwif->io_ports[IDE_DATA_OFFSET],
hwif->io_ports[IDE_DATA_OFFSET]+7,
hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq));
#else
printk("%s at 0x%08lx on irq %d", hwif->name,
hwif->io_ports[IDE_DATA_OFFSET], hwif->irq);
......
......@@ -694,13 +694,8 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
goto out;
}
if (noisy)
#ifdef __sparc__
printk(KERN_INFO "%s: 100%% native mode on irq %s\n",
d->name, __irq_itoa(pciirq));
#else
printk(KERN_INFO "%s: 100%% native mode on irq %d\n",
d->name, pciirq);
#endif
}
/* FIXME: silent failure can happen */
......
......@@ -586,11 +586,7 @@ static void ohci_initialize(struct ti_ohci *ohci)
reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable);
buf = reg_read(ohci, OHCI1394_Version);
#ifndef __sparc__
sprintf (irq_buf, "%d", ohci->dev->irq);
#else
sprintf (irq_buf, "%s", __irq_itoa(ohci->dev->irq));
#endif
PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%s] "
"MMIO=[%lx-%lx] Max Packet=[%d] IR/IT contexts=[%d/%d]",
((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10),
......
......@@ -1252,11 +1252,7 @@ static int __devinit add_card(struct pci_dev *dev,
/* Fix buggy cards with autoboot pin not tied low: */
reg_write(lynx, DMA0_CHAN_CTRL, 0);
#ifndef __sparc__
sprintf (irq_buf, "%d", dev->irq);
#else
sprintf (irq_buf, "%s", __irq_itoa(dev->irq));
#endif
if (!request_irq(dev->irq, lynx_irq_handler, SA_SHIRQ,
PCILYNX_DRIVER_NAME, lynx)) {
......
......@@ -63,9 +63,6 @@
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
#ifdef __sparc__
#include <asm/irq.h> /* needed for __irq_itoa() proto */
#endif
#include "mptbase.h"
......@@ -1394,13 +1391,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
r = request_irq(pdev->irq, mpt_interrupt, SA_SHIRQ, ioc->name, ioc);
if (r < 0) {
#ifndef __sparc__
printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %d!\n",
ioc->name, pdev->irq);
#else
printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %s!\n",
ioc->name, __irq_itoa(pdev->irq));
#endif
list_del(&ioc->list);
iounmap(mem);
kfree(ioc);
......@@ -1412,11 +1404,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
pci_set_master(pdev); /* ?? */
pci_set_drvdata(pdev, ioc);
#ifndef __sparc__
dprintk((KERN_INFO MYNAM ": %s installed at interrupt %d\n", ioc->name, pdev->irq));
#else
dprintk((KERN_INFO MYNAM ": %s installed at interrupt %s\n", ioc->name, __irq_itoa(pdev->irq)));
#endif
}
/* Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
......@@ -5647,11 +5635,7 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh
a[5], a[4], a[3], a[2], a[1], a[0]);
}
#ifndef __sparc__
y += sprintf(buffer+len+y, ", IRQ=%d", ioc->pci_irq);
#else
y += sprintf(buffer+len+y, ", IRQ=%s", __irq_itoa(ioc->pci_irq));
#endif
if (!ioc->active)
y += sprintf(buffer+len+y, " (disabled)");
......
......@@ -1382,17 +1382,12 @@ static int __devinit vortex_probe1(struct device *gendev,
for (i = 0; i < 6; i++)
iowrite8(dev->dev_addr[i], ioaddr + i);
#ifdef __sparc__
if (print_info)
printk(", IRQ %s\n", __irq_itoa(dev->irq));
#else
if (print_info)
printk(", IRQ %d\n", dev->irq);
/* Tell them about an invalid IRQ. */
if (dev->irq <= 0 || dev->irq >= NR_IRQS)
printk(KERN_WARNING " *** Warning: IRQ %d is unlikely to work! ***\n",
dev->irq);
#endif
EL3WINDOW(4);
step = (ioread8(ioaddr + Wn4_NetDiag) & 0x1e) >> 1;
......
......@@ -579,11 +579,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
}
printk("Gigabit Ethernet at 0x%08lx, ", dev->base_addr);
#ifdef __sparc__
printk("irq %s\n", __irq_itoa(pdev->irq));
#else
printk("irq %i\n", pdev->irq);
#endif
printk("irq %d\n", pdev->irq);
#ifdef CONFIG_ACENIC_OMIT_TIGON_I
if ((readl(&ap->regs->HostCtrl) >> 28) == 4) {
......
......@@ -2221,13 +2221,8 @@ static int happy_meal_open(struct net_device *dev)
if (request_irq(dev->irq, &happy_meal_interrupt,
SA_SHIRQ, dev->name, (void *)dev)) {
HMD(("EAGAIN\n"));
#ifdef __sparc__
printk(KERN_ERR "happy_meal(SBUS): Can't order irq %s to go.\n",
__irq_itoa(dev->irq));
#else
printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n",
dev->irq);
#endif
return -EAGAIN;
}
......
......@@ -936,7 +936,7 @@ static int lance_open(struct net_device *dev)
if (request_irq(dev->irq, &lance_interrupt, SA_SHIRQ,
lancestr, (void *) dev)) {
printk(KERN_ERR "Lance: Can't get irq %s\n", __irq_itoa(dev->irq));
printk(KERN_ERR "Lance: Can't get irq %d\n", dev->irq);
return -EAGAIN;
}
......
......@@ -304,8 +304,8 @@ static int wd_open(struct inode *inode, struct file *f)
SA_SHIRQ,
WD_OBPNAME,
(void *)wd_dev.regs)) {
printk("%s: Cannot register IRQ %s\n",
WD_OBPNAME, __irq_itoa(wd_dev.irq));
printk("%s: Cannot register IRQ %d\n",
WD_OBPNAME, wd_dev.irq);
return(-EBUSY);
}
wd_dev.initialized = 1;
......
......@@ -400,7 +400,7 @@ static int __init ts102_uctrl_init(void)
}
driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK;
printk("uctrl: 0x%x (irq %s)\n", driver->regs, __irq_itoa(driver->irq));
printk("uctrl: 0x%x (irq %d)\n", driver->regs, driver->irq);
uctrl_get_event_status();
uctrl_get_external_status();
return 0;
......
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