sparc/of: Move of_device fields into struct pdev_archdata

This patch moves SPARC architecture specific data members out of
struct of_device and into the pdev_archdata structure.  The reason
for this change is to unify the struct of_device definition amongst
all the architectures.  It also remvoes the .sysdata, .slot, .portid
and .clock_freq properties because they aren't actually used by
anything.

A subsequent patch will replace struct of_device entirely with struct
platform_device and the of_platform support code will share common
routines with the platform bus (but the bus instances themselves can
remain separate).

This patch also adds 'struct resources *resource' and num_resources
to match the fields defined in struct platform_device.  After this
change, 'struct platform_device' can be used as a drop-in replacement
for 'struct of_platform'.

This change is in preparation for merging the of_platform_bus_type
with the platform_bus_type.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
This commit is contained in:
Grant Likely 2010-06-18 11:09:58 -06:00
parent 2b07be2493
commit 1636f8ac2b
33 changed files with 100 additions and 108 deletions

View File

@ -6,6 +6,8 @@
#ifndef _ASM_SPARC_DEVICE_H #ifndef _ASM_SPARC_DEVICE_H
#define _ASM_SPARC_DEVICE_H #define _ASM_SPARC_DEVICE_H
#include <asm/openprom.h>
struct device_node; struct device_node;
struct of_device; struct of_device;
@ -18,6 +20,9 @@ struct dev_archdata {
}; };
struct pdev_archdata { struct pdev_archdata {
struct resource resource[PROMREG_MAX];
unsigned int irqs[PROMINTR_MAX];
int num_irqs;
}; };
#endif /* _ASM_SPARC_DEVICE_H */ #endif /* _ASM_SPARC_DEVICE_H */

View File

@ -567,7 +567,7 @@ static unsigned long __init sun_floppy_init(void)
} }
if (op) { if (op) {
floppy_op = op; floppy_op = op;
FLOPPY_IRQ = op->irqs[0]; FLOPPY_IRQ = op->archdata.irqs[0];
} else { } else {
struct device_node *ebus_dp; struct device_node *ebus_dp;
void __iomem *auxio_reg; void __iomem *auxio_reg;
@ -593,7 +593,7 @@ static unsigned long __init sun_floppy_init(void)
if (state_prop && !strncmp(state_prop, "disabled", 8)) if (state_prop && !strncmp(state_prop, "disabled", 8))
return 0; return 0;
FLOPPY_IRQ = op->irqs[0]; FLOPPY_IRQ = op->archdata.irqs[0];
/* Make sure the high density bit is set, some systems /* Make sure the high density bit is set, some systems
* (most notably Ultra5/Ultra10) come up with it clear. * (most notably Ultra5/Ultra10) come up with it clear.

View File

@ -15,15 +15,10 @@
struct of_device struct of_device
{ {
struct device dev; struct device dev;
struct resource resource[PROMREG_MAX]; u32 num_resources;
unsigned int irqs[PROMINTR_MAX]; struct resource *resource;
int num_irqs;
void *sysdata; struct pdev_archdata archdata;
int slot;
int portid;
int clock_freq;
}; };
extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);

View File

@ -116,7 +116,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
parent = op->dev.of_node->parent; parent = op->dev.of_node->parent;
if (!strcmp(parent->name, "dma")) { if (!strcmp(parent->name, "dma")) {
p = parport_pc_probe_port(base, base + 0x400, p = parport_pc_probe_port(base, base + 0x400,
op->irqs[0], PARPORT_DMA_NOFIFO, op->archdata.irqs[0], PARPORT_DMA_NOFIFO,
op->dev.parent->parent, 0); op->dev.parent->parent, 0);
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
@ -166,7 +166,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
0, PTR_LPT_REG_DIR); 0, PTR_LPT_REG_DIR);
p = parport_pc_probe_port(base, base + 0x400, p = parport_pc_probe_port(base, base + 0x400,
op->irqs[0], op->archdata.irqs[0],
slot, slot,
op->dev.parent, op->dev.parent,
0); 0);

View File

@ -267,6 +267,8 @@ static void __init build_device_resources(struct of_device *op,
/* Conver to num-entries. */ /* Conver to num-entries. */
num_reg /= na + ns; num_reg /= na + ns;
op->resource = op->archdata.resource;
op->num_resources = num_reg;
for (index = 0; index < num_reg; index++) { for (index = 0; index < num_reg; index++) {
struct resource *r = &op->resource[index]; struct resource *r = &op->resource[index];
u32 addr[OF_MAX_ADDR_CELLS]; u32 addr[OF_MAX_ADDR_CELLS];
@ -349,27 +351,21 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
op->dev.of_node = dp; op->dev.of_node = dp;
op->clock_freq = of_getintprop_default(dp, "clock-frequency",
(25*1000*1000));
op->portid = of_getintprop_default(dp, "upa-portid", -1);
if (op->portid == -1)
op->portid = of_getintprop_default(dp, "portid", -1);
intr = of_get_property(dp, "intr", &len); intr = of_get_property(dp, "intr", &len);
if (intr) { if (intr) {
op->num_irqs = len / sizeof(struct linux_prom_irqs); op->archdata.num_irqs = len / sizeof(struct linux_prom_irqs);
for (i = 0; i < op->num_irqs; i++) for (i = 0; i < op->archdata.num_irqs; i++)
op->irqs[i] = intr[i].pri; op->archdata.irqs[i] = intr[i].pri;
} else { } else {
const unsigned int *irq = const unsigned int *irq =
of_get_property(dp, "interrupts", &len); of_get_property(dp, "interrupts", &len);
if (irq) { if (irq) {
op->num_irqs = len / sizeof(unsigned int); op->archdata.num_irqs = len / sizeof(unsigned int);
for (i = 0; i < op->num_irqs; i++) for (i = 0; i < op->archdata.num_irqs; i++)
op->irqs[i] = irq[i]; op->archdata.irqs[i] = irq[i];
} else { } else {
op->num_irqs = 0; op->archdata.num_irqs = 0;
} }
} }
if (sparc_cpu_model == sun4d) { if (sparc_cpu_model == sun4d) {
@ -411,8 +407,8 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
goto build_resources; goto build_resources;
} }
for (i = 0; i < op->num_irqs; i++) { for (i = 0; i < op->archdata.num_irqs; i++) {
int this_irq = op->irqs[i]; int this_irq = op->archdata.irqs[i];
int sbusl = pil_to_sbus[this_irq]; int sbusl = pil_to_sbus[this_irq];
if (sbusl) if (sbusl)
@ -420,7 +416,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
(sbusl << 2) + (sbusl << 2) +
slot); slot);
op->irqs[i] = this_irq; op->archdata.irqs[i] = this_irq;
} }
} }

View File

@ -344,6 +344,8 @@ static void __init build_device_resources(struct of_device *op,
num_reg = PROMREG_MAX; num_reg = PROMREG_MAX;
} }
op->resource = op->archdata.resource;
op->num_resources = num_reg;
for (index = 0; index < num_reg; index++) { for (index = 0; index < num_reg; index++) {
struct resource *r = &op->resource[index]; struct resource *r = &op->resource[index];
u32 addr[OF_MAX_ADDR_CELLS]; u32 addr[OF_MAX_ADDR_CELLS];
@ -644,31 +646,25 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
op->dev.of_node = dp; op->dev.of_node = dp;
op->clock_freq = of_getintprop_default(dp, "clock-frequency",
(25*1000*1000));
op->portid = of_getintprop_default(dp, "upa-portid", -1);
if (op->portid == -1)
op->portid = of_getintprop_default(dp, "portid", -1);
irq = of_get_property(dp, "interrupts", &len); irq = of_get_property(dp, "interrupts", &len);
if (irq) { if (irq) {
op->num_irqs = len / 4; op->archdata.num_irqs = len / 4;
/* Prevent overrunning the op->irqs[] array. */ /* Prevent overrunning the op->irqs[] array. */
if (op->num_irqs > PROMINTR_MAX) { if (op->archdata.num_irqs > PROMINTR_MAX) {
printk(KERN_WARNING "%s: Too many irqs (%d), " printk(KERN_WARNING "%s: Too many irqs (%d), "
"limiting to %d.\n", "limiting to %d.\n",
dp->full_name, op->num_irqs, PROMINTR_MAX); dp->full_name, op->archdata.num_irqs, PROMINTR_MAX);
op->num_irqs = PROMINTR_MAX; op->archdata.num_irqs = PROMINTR_MAX;
} }
memcpy(op->irqs, irq, op->num_irqs * 4); memcpy(op->archdata.irqs, irq, op->archdata.num_irqs * 4);
} else { } else {
op->num_irqs = 0; op->archdata.num_irqs = 0;
} }
build_device_resources(op, parent); build_device_resources(op, parent);
for (i = 0; i < op->num_irqs; i++) for (i = 0; i < op->archdata.num_irqs; i++)
op->irqs[i] = build_one_device_irq(op, parent, op->irqs[i]); op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]);
op->dev.parent = parent; op->dev.parent = parent;
op->dev.bus = &of_platform_bus_type; op->dev.bus = &of_platform_bus_type;

View File

@ -35,10 +35,10 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index)
{ {
struct of_device *op = of_find_device_by_node(node); struct of_device *op = of_find_device_by_node(node);
if (!op || index >= op->num_irqs) if (!op || index >= op->archdata.num_irqs)
return 0; return 0;
return op->irqs[index]; return op->archdata.irqs[index];
} }
EXPORT_SYMBOL(irq_of_parse_and_map); EXPORT_SYMBOL(irq_of_parse_and_map);

View File

@ -340,7 +340,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
dev->hdr_type = PCI_HEADER_TYPE_NORMAL; dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
dev->rom_base_reg = PCI_ROM_ADDRESS; dev->rom_base_reg = PCI_ROM_ADDRESS;
dev->irq = sd->op->irqs[0]; dev->irq = sd->op->archdata.irqs[0];
if (dev->irq == 0xffffffff) if (dev->irq == 0xffffffff)
dev->irq = PCI_IRQ_NONE; dev->irq = PCI_IRQ_NONE;
} }

View File

@ -302,23 +302,23 @@ static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
* 5: POWER MANAGEMENT * 5: POWER MANAGEMENT
*/ */
if (op->num_irqs < 6) if (op->archdata.num_irqs < 6)
return; return;
/* We really mean to ignore the return result here. Two /* We really mean to ignore the return result here. Two
* PCI controller share the same interrupt numbers and * PCI controller share the same interrupt numbers and
* drive the same front-end hardware. * drive the same front-end hardware.
*/ */
err = request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED, err = request_irq(op->archdata.irqs[1], psycho_ue_intr, IRQF_SHARED,
"PSYCHO_UE", pbm); "PSYCHO_UE", pbm);
err = request_irq(op->irqs[2], psycho_ce_intr, IRQF_SHARED, err = request_irq(op->archdata.irqs[2], psycho_ce_intr, IRQF_SHARED,
"PSYCHO_CE", pbm); "PSYCHO_CE", pbm);
/* This one, however, ought not to fail. We can just warn /* This one, however, ought not to fail. We can just warn
* about it since the system can still operate properly even * about it since the system can still operate properly even
* if this fails. * if this fails.
*/ */
err = request_irq(op->irqs[0], psycho_pcierr_intr, IRQF_SHARED, err = request_irq(op->archdata.irqs[0], psycho_pcierr_intr, IRQF_SHARED,
"PSYCHO_PCIERR", pbm); "PSYCHO_PCIERR", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register PCIERR, " printk(KERN_WARNING "%s: Could not register PCIERR, "

View File

@ -329,7 +329,7 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
* 2: CE ERR * 2: CE ERR
* 3: POWER FAIL * 3: POWER FAIL
*/ */
if (op->num_irqs < 4) if (op->archdata.num_irqs < 4)
return; return;
/* We clear the error bits in the appropriate AFSR before /* We clear the error bits in the appropriate AFSR before
@ -341,7 +341,7 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE), SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE),
base + SABRE_UE_AFSR); base + SABRE_UE_AFSR);
err = request_irq(op->irqs[1], sabre_ue_intr, 0, "SABRE_UE", pbm); err = request_irq(op->archdata.irqs[1], sabre_ue_intr, 0, "SABRE_UE", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Couldn't register UE, err=%d.\n", printk(KERN_WARNING "%s: Couldn't register UE, err=%d.\n",
pbm->name, err); pbm->name, err);
@ -351,11 +351,11 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
base + SABRE_CE_AFSR); base + SABRE_CE_AFSR);
err = request_irq(op->irqs[2], sabre_ce_intr, 0, "SABRE_CE", pbm); err = request_irq(op->archdata.irqs[2], sabre_ce_intr, 0, "SABRE_CE", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Couldn't register CE, err=%d.\n", printk(KERN_WARNING "%s: Couldn't register CE, err=%d.\n",
pbm->name, err); pbm->name, err);
err = request_irq(op->irqs[0], psycho_pcierr_intr, 0, err = request_irq(op->archdata.irqs[0], psycho_pcierr_intr, 0,
"SABRE_PCIERR", pbm); "SABRE_PCIERR", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Couldn't register PCIERR, err=%d.\n", printk(KERN_WARNING "%s: Couldn't register PCIERR, err=%d.\n",

View File

@ -857,14 +857,14 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
*/ */
if (pbm_routes_this_ino(pbm, SCHIZO_UE_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_UE_INO)) {
err = request_irq(op->irqs[1], schizo_ue_intr, 0, err = request_irq(op->archdata.irqs[1], schizo_ue_intr, 0,
"TOMATILLO_UE", pbm); "TOMATILLO_UE", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register UE, " printk(KERN_WARNING "%s: Could not register UE, "
"err=%d\n", pbm->name, err); "err=%d\n", pbm->name, err);
} }
if (pbm_routes_this_ino(pbm, SCHIZO_CE_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_CE_INO)) {
err = request_irq(op->irqs[2], schizo_ce_intr, 0, err = request_irq(op->archdata.irqs[2], schizo_ce_intr, 0,
"TOMATILLO_CE", pbm); "TOMATILLO_CE", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register CE, " printk(KERN_WARNING "%s: Could not register CE, "
@ -872,10 +872,10 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
} }
err = 0; err = 0;
if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_A_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_A_INO)) {
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0, err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
"TOMATILLO_PCIERR", pbm); "TOMATILLO_PCIERR", pbm);
} else if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_B_INO)) { } else if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_B_INO)) {
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0, err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
"TOMATILLO_PCIERR", pbm); "TOMATILLO_PCIERR", pbm);
} }
if (err) if (err)
@ -883,7 +883,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
"err=%d\n", pbm->name, err); "err=%d\n", pbm->name, err);
if (pbm_routes_this_ino(pbm, SCHIZO_SERR_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_SERR_INO)) {
err = request_irq(op->irqs[3], schizo_safarierr_intr, 0, err = request_irq(op->archdata.irqs[3], schizo_safarierr_intr, 0,
"TOMATILLO_SERR", pbm); "TOMATILLO_SERR", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register SERR, " printk(KERN_WARNING "%s: Could not register SERR, "
@ -952,14 +952,14 @@ static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
*/ */
if (pbm_routes_this_ino(pbm, SCHIZO_UE_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_UE_INO)) {
err = request_irq(op->irqs[1], schizo_ue_intr, 0, err = request_irq(op->archdata.irqs[1], schizo_ue_intr, 0,
"SCHIZO_UE", pbm); "SCHIZO_UE", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register UE, " printk(KERN_WARNING "%s: Could not register UE, "
"err=%d\n", pbm->name, err); "err=%d\n", pbm->name, err);
} }
if (pbm_routes_this_ino(pbm, SCHIZO_CE_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_CE_INO)) {
err = request_irq(op->irqs[2], schizo_ce_intr, 0, err = request_irq(op->archdata.irqs[2], schizo_ce_intr, 0,
"SCHIZO_CE", pbm); "SCHIZO_CE", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register CE, " printk(KERN_WARNING "%s: Could not register CE, "
@ -967,10 +967,10 @@ static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
} }
err = 0; err = 0;
if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_A_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_A_INO)) {
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0, err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
"SCHIZO_PCIERR", pbm); "SCHIZO_PCIERR", pbm);
} else if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_B_INO)) { } else if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_B_INO)) {
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0, err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
"SCHIZO_PCIERR", pbm); "SCHIZO_PCIERR", pbm);
} }
if (err) if (err)
@ -978,7 +978,7 @@ static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
"err=%d\n", pbm->name, err); "err=%d\n", pbm->name, err);
if (pbm_routes_this_ino(pbm, SCHIZO_SERR_INO)) { if (pbm_routes_this_ino(pbm, SCHIZO_SERR_INO)) {
err = request_irq(op->irqs[3], schizo_safarierr_intr, 0, err = request_irq(op->archdata.irqs[3], schizo_safarierr_intr, 0,
"SCHIZO_SERR", pbm); "SCHIZO_SERR", pbm);
if (err) if (err)
printk(KERN_WARNING "%s: Could not register SERR, " printk(KERN_WARNING "%s: Could not register SERR, "

View File

@ -36,7 +36,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
static int __devinit power_probe(struct of_device *op, const struct of_device_id *match) static int __devinit power_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct resource *res = &op->resource[0]; struct resource *res = &op->resource[0];
unsigned int irq= op->irqs[0]; unsigned int irq = op->archdata.irqs[0];
power_reg = of_ioremap(res, 0, 0x4, "power"); power_reg = of_ioremap(res, 0, 0x4, "power");

View File

@ -2657,7 +2657,7 @@ static int __devinit fore200e_sba_probe(struct of_device *op,
fore200e->bus = bus; fore200e->bus = bus;
fore200e->bus_dev = op; fore200e->bus_dev = op;
fore200e->irq = op->irqs[0]; fore200e->irq = op->archdata.irqs[0];
fore200e->phys_base = op->resource[0].start; fore200e->phys_base = op->resource[0].start;
sprintf(fore200e->name, "%s-%d", bus->model_name, index); sprintf(fore200e->name, "%s-%d", bus->model_name, index);

View File

@ -58,9 +58,9 @@ static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_dev
if (!strcmp(dp->name, OBP_PS2KBD_NAME1) || if (!strcmp(dp->name, OBP_PS2KBD_NAME1) ||
!strcmp(dp->name, OBP_PS2KBD_NAME2)) { !strcmp(dp->name, OBP_PS2KBD_NAME2)) {
struct of_device *kbd = of_find_device_by_node(dp); struct of_device *kbd = of_find_device_by_node(dp);
unsigned int irq = kbd->irqs[0]; unsigned int irq = kbd->archdata.irqs[0];
if (irq == 0xffffffff) if (irq == 0xffffffff)
irq = op->irqs[0]; irq = op->archdata.irqs[0];
i8042_kbd_irq = irq; i8042_kbd_irq = irq;
kbd_iobase = of_ioremap(&kbd->resource[0], kbd_iobase = of_ioremap(&kbd->resource[0],
0, 8, "kbd"); 0, 8, "kbd");
@ -68,9 +68,9 @@ static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_dev
} else if (!strcmp(dp->name, OBP_PS2MS_NAME1) || } else if (!strcmp(dp->name, OBP_PS2MS_NAME1) ||
!strcmp(dp->name, OBP_PS2MS_NAME2)) { !strcmp(dp->name, OBP_PS2MS_NAME2)) {
struct of_device *ms = of_find_device_by_node(dp); struct of_device *ms = of_find_device_by_node(dp);
unsigned int irq = ms->irqs[0]; unsigned int irq = ms->archdata.irqs[0];
if (irq == 0xffffffff) if (irq == 0xffffffff)
irq = op->irqs[0]; irq = op->archdata.irqs[0];
i8042_aux_irq = irq; i8042_aux_irq = irq;
} }

View File

@ -1079,7 +1079,7 @@ static int __devinit myri_sbus_probe(struct of_device *op, const struct of_devic
mp->dev = dev; mp->dev = dev;
dev->watchdog_timeo = 5*HZ; dev->watchdog_timeo = 5*HZ;
dev->irq = op->irqs[0]; dev->irq = op->archdata.irqs[0];
dev->netdev_ops = &myri_ops; dev->netdev_ops = &myri_ops;
/* Register interrupt handler now. */ /* Register interrupt handler now. */

View File

@ -9119,12 +9119,12 @@ static int __devinit niu_n2_irq_init(struct niu *np, u8 *ldg_num_map)
if (!int_prop) if (!int_prop)
return -ENODEV; return -ENODEV;
for (i = 0; i < op->num_irqs; i++) { for (i = 0; i < op->archdata.num_irqs; i++) {
ldg_num_map[i] = int_prop[i]; ldg_num_map[i] = int_prop[i];
np->ldg[i].irq = op->irqs[i]; np->ldg[i].irq = op->archdata.irqs[i];
} }
np->num_ldg = op->num_irqs; np->num_ldg = op->archdata.num_irqs;
return 0; return 0;
#else #else

View File

@ -1201,7 +1201,7 @@ static int __devinit bigmac_ether_init(struct of_device *op,
dev->watchdog_timeo = 5*HZ; dev->watchdog_timeo = 5*HZ;
/* Finish net device registration. */ /* Finish net device registration. */
dev->irq = bp->bigmac_op->irqs[0]; dev->irq = bp->bigmac_op->archdata.irqs[0];
dev->dma = 0; dev->dma = 0;
if (register_netdev(dev)) { if (register_netdev(dev)) {

View File

@ -2561,7 +2561,7 @@ static int __init quattro_sbus_register_irqs(void)
if (skip) if (skip)
continue; continue;
err = request_irq(op->irqs[0], err = request_irq(op->archdata.irqs[0],
quattro_sbus_interrupt, quattro_sbus_interrupt,
IRQF_SHARED, "Quattro", IRQF_SHARED, "Quattro",
qp); qp);
@ -2590,7 +2590,7 @@ static void quattro_sbus_free_irqs(void)
if (skip) if (skip)
continue; continue;
free_irq(op->irqs[0], qp); free_irq(op->archdata.irqs[0], qp);
} }
} }
#endif /* CONFIG_SBUS */ #endif /* CONFIG_SBUS */
@ -2790,7 +2790,7 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
/* Happy Meal can do it all... */ /* Happy Meal can do it all... */
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->irq = op->irqs[0]; dev->irq = op->archdata.irqs[0];
#if defined(CONFIG_SBUS) && defined(CONFIG_PCI) #if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
/* Hook up SBUS register/descriptor accessors. */ /* Hook up SBUS register/descriptor accessors. */

View File

@ -1474,7 +1474,7 @@ static int __devinit sparc_lance_probe_one(struct of_device *op,
dev->ethtool_ops = &sparc_lance_ethtool_ops; dev->ethtool_ops = &sparc_lance_ethtool_ops;
dev->netdev_ops = &sparc_lance_ops; dev->netdev_ops = &sparc_lance_ops;
dev->irq = op->irqs[0]; dev->irq = op->archdata.irqs[0];
/* We cannot sleep if the chip is busy during a /* We cannot sleep if the chip is busy during a
* multicast list update event, because such events * multicast list update event, because such events

View File

@ -803,7 +803,7 @@ static struct sunqec * __devinit get_qec(struct of_device *child)
qec_init_once(qecp, op); qec_init_once(qecp, op);
if (request_irq(op->irqs[0], qec_interrupt, if (request_irq(op->archdata.irqs[0], qec_interrupt,
IRQF_SHARED, "qec", (void *) qecp)) { IRQF_SHARED, "qec", (void *) qecp)) {
printk(KERN_ERR "qec: Can't register irq.\n"); printk(KERN_ERR "qec: Can't register irq.\n");
goto fail; goto fail;
@ -901,7 +901,7 @@ static int __devinit qec_ether_init(struct of_device *op)
SET_NETDEV_DEV(dev, &op->dev); SET_NETDEV_DEV(dev, &op->dev);
dev->watchdog_timeo = 5*HZ; dev->watchdog_timeo = 5*HZ;
dev->irq = op->irqs[0]; dev->irq = op->archdata.irqs[0];
dev->dma = 0; dev->dma = 0;
dev->ethtool_ops = &qe_ethtool_ops; dev->ethtool_ops = &qe_ethtool_ops;
dev->netdev_ops = &qec_ops; dev->netdev_ops = &qec_ops;
@ -999,7 +999,7 @@ static void __exit qec_exit(void)
struct sunqec *next = root_qec_dev->next_module; struct sunqec *next = root_qec_dev->next_module;
struct of_device *op = root_qec_dev->op; struct of_device *op = root_qec_dev->op;
free_irq(op->irqs[0], (void *) root_qec_dev); free_irq(op->archdata.irqs[0], (void *) root_qec_dev);
of_iounmap(&op->resource[0], root_qec_dev->gregs, of_iounmap(&op->resource[0], root_qec_dev->gregs,
GLOB_REG_SIZE); GLOB_REG_SIZE);
kfree(root_qec_dev); kfree(root_qec_dev);

View File

@ -295,7 +295,7 @@ static int __devinit bpp_probe(struct of_device *op, const struct of_device_id *
void __iomem *base; void __iomem *base;
struct parport *p; struct parport *p;
irq = op->irqs[0]; irq = op->archdata.irqs[0];
base = of_ioremap(&op->resource[0], 0, base = of_ioremap(&op->resource[0], 0,
resource_size(&op->resource[0]), resource_size(&op->resource[0]),
"sunbpp"); "sunbpp");

View File

@ -317,7 +317,7 @@ static struct bbc_i2c_bus * __init attach_one_i2c(struct of_device *op, int inde
bp->waiting = 0; bp->waiting = 0;
init_waitqueue_head(&bp->wq); init_waitqueue_head(&bp->wq);
if (request_irq(op->irqs[0], bbc_i2c_interrupt, if (request_irq(op->archdata.irqs[0], bbc_i2c_interrupt,
IRQF_SHARED, "bbc_i2c", bp)) IRQF_SHARED, "bbc_i2c", bp))
goto fail; goto fail;
@ -373,7 +373,7 @@ static int __devinit bbc_i2c_probe(struct of_device *op,
err = bbc_envctrl_init(bp); err = bbc_envctrl_init(bp);
if (err) { if (err) {
free_irq(op->irqs[0], bp); free_irq(op->archdata.irqs[0], bp);
if (bp->i2c_bussel_reg) if (bp->i2c_bussel_reg)
of_iounmap(&op->resource[0], bp->i2c_bussel_reg, 1); of_iounmap(&op->resource[0], bp->i2c_bussel_reg, 1);
if (bp->i2c_control_regs) if (bp->i2c_control_regs)
@ -392,7 +392,7 @@ static int __devexit bbc_i2c_remove(struct of_device *op)
bbc_envctrl_cleanup(bp); bbc_envctrl_cleanup(bp);
free_irq(op->irqs[0], bp); free_irq(op->archdata.irqs[0], bp);
if (bp->i2c_bussel_reg) if (bp->i2c_bussel_reg)
of_iounmap(&op->resource[0], bp->i2c_bussel_reg, 1); of_iounmap(&op->resource[0], bp->i2c_bussel_reg, 1);

View File

@ -367,7 +367,7 @@ static int __devinit uctrl_probe(struct of_device *op,
goto out_free; goto out_free;
} }
p->irq = op->irqs[0]; p->irq = op->archdata.irqs[0];
err = request_irq(p->irq, uctrl_interrupt, 0, "uctrl", p); err = request_irq(p->irq, uctrl_interrupt, 0, "uctrl", p);
if (err) { if (err) {
printk(KERN_ERR "uctrl: Unable to register irq.\n"); printk(KERN_ERR "uctrl: Unable to register irq.\n");

View File

@ -729,7 +729,7 @@ static int __devinit qpti_register_irq(struct qlogicpti *qpti)
{ {
struct of_device *op = qpti->op; struct of_device *op = qpti->op;
qpti->qhost->irq = qpti->irq = op->irqs[0]; qpti->qhost->irq = qpti->irq = op->archdata.irqs[0];
/* We used to try various overly-clever things to /* We used to try various overly-clever things to
* reduce the interrupt processing overhead on * reduce the interrupt processing overhead on
@ -1302,7 +1302,7 @@ static int __devinit qpti_sbus_probe(struct of_device *op, const struct of_devic
/* Sometimes Antares cards come up not completely /* Sometimes Antares cards come up not completely
* setup, and we get a report of a zero IRQ. * setup, and we get a report of a zero IRQ.
*/ */
if (op->irqs[0] == 0) if (op->archdata.irqs[0] == 0)
return -ENODEV; return -ENODEV;
host = scsi_host_alloc(tpnt, sizeof(struct qlogicpti)); host = scsi_host_alloc(tpnt, sizeof(struct qlogicpti));

View File

@ -116,7 +116,7 @@ static int __devinit esp_sbus_register_irq(struct esp *esp)
struct Scsi_Host *host = esp->host; struct Scsi_Host *host = esp->host;
struct of_device *op = esp->dev; struct of_device *op = esp->dev;
host->irq = op->irqs[0]; host->irq = op->archdata.irqs[0];
return request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "ESP", esp); return request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "ESP", esp);
} }

View File

@ -525,7 +525,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
unsigned long minor; unsigned long minor;
int err; int err;
if (op->irqs[0] == 0xffffffff) if (op->archdata.irqs[0] == 0xffffffff)
return -ENODEV; return -ENODEV;
port = kzalloc(sizeof(struct uart_port), GFP_KERNEL); port = kzalloc(sizeof(struct uart_port), GFP_KERNEL);
@ -557,7 +557,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
port->membase = (unsigned char __iomem *) __pa(port); port->membase = (unsigned char __iomem *) __pa(port);
port->irq = op->irqs[0]; port->irq = op->archdata.irqs[0];
port->dev = &op->dev; port->dev = &op->dev;

View File

@ -969,7 +969,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up,
return -ENOMEM; return -ENOMEM;
up->regs = (union sab82532_async_regs __iomem *) up->port.membase; up->regs = (union sab82532_async_regs __iomem *) up->port.membase;
up->port.irq = op->irqs[0]; up->port.irq = op->archdata.irqs[0];
up->port.fifosize = SAB82532_XMIT_FIFO_SIZE; up->port.fifosize = SAB82532_XMIT_FIFO_SIZE;
up->port.iotype = UPIO_MEM; up->port.iotype = UPIO_MEM;

View File

@ -1443,7 +1443,7 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
return -ENOMEM; return -ENOMEM;
} }
up->port.irq = op->irqs[0]; up->port.irq = op->archdata.irqs[0];
up->port.dev = &op->dev; up->port.dev = &op->dev;

View File

@ -1426,7 +1426,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
rp = sunzilog_chip_regs[inst]; rp = sunzilog_chip_regs[inst];
if (zilog_irq == -1) if (zilog_irq == -1)
zilog_irq = op->irqs[0]; zilog_irq = op->archdata.irqs[0];
up = &sunzilog_port_table[inst * 2]; up = &sunzilog_port_table[inst * 2];
@ -1434,7 +1434,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
up[0].port.mapbase = op->resource[0].start + 0x00; up[0].port.mapbase = op->resource[0].start + 0x00;
up[0].port.membase = (void __iomem *) &rp->channelA; up[0].port.membase = (void __iomem *) &rp->channelA;
up[0].port.iotype = UPIO_MEM; up[0].port.iotype = UPIO_MEM;
up[0].port.irq = op->irqs[0]; up[0].port.irq = op->archdata.irqs[0];
up[0].port.uartclk = ZS_CLOCK; up[0].port.uartclk = ZS_CLOCK;
up[0].port.fifosize = 1; up[0].port.fifosize = 1;
up[0].port.ops = &sunzilog_pops; up[0].port.ops = &sunzilog_pops;
@ -1451,7 +1451,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
up[1].port.mapbase = op->resource[0].start + 0x04; up[1].port.mapbase = op->resource[0].start + 0x04;
up[1].port.membase = (void __iomem *) &rp->channelB; up[1].port.membase = (void __iomem *) &rp->channelB;
up[1].port.iotype = UPIO_MEM; up[1].port.iotype = UPIO_MEM;
up[1].port.irq = op->irqs[0]; up[1].port.irq = op->archdata.irqs[0];
up[1].port.uartclk = ZS_CLOCK; up[1].port.uartclk = ZS_CLOCK;
up[1].port.fifosize = 1; up[1].port.fifosize = 1;
up[1].port.ops = &sunzilog_pops; up[1].port.ops = &sunzilog_pops;
@ -1492,12 +1492,12 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
"is a %s\n", "is a %s\n",
dev_name(&op->dev), dev_name(&op->dev),
(unsigned long long) up[0].port.mapbase, (unsigned long long) up[0].port.mapbase,
op->irqs[0], sunzilog_type(&up[0].port)); op->archdata.irqs[0], sunzilog_type(&up[0].port));
printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) " printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) "
"is a %s\n", "is a %s\n",
dev_name(&op->dev), dev_name(&op->dev),
(unsigned long long) up[1].port.mapbase, (unsigned long long) up[1].port.mapbase,
op->irqs[0], sunzilog_type(&up[1].port)); op->archdata.irqs[0], sunzilog_type(&up[1].port));
kbm_inst++; kbm_inst++;
} }

View File

@ -545,7 +545,7 @@ static int __devinit cpwd_probe(struct of_device *op,
goto out; goto out;
} }
p->irq = op->irqs[0]; p->irq = op->archdata.irqs[0];
spin_lock_init(&p->lock); spin_lock_init(&p->lock);

View File

@ -1010,7 +1010,7 @@ static int __devinit amd7930_sbus_probe(struct of_device *op, const struct of_de
struct snd_amd7930 *amd; struct snd_amd7930 *amd;
int err, irq; int err, irq;
irq = op->irqs[0]; irq = op->archdata.irqs[0];
if (dev_num >= SNDRV_CARDS) if (dev_num >= SNDRV_CARDS)
return -ENODEV; return -ENODEV;

View File

@ -1832,14 +1832,14 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
chip->c_dma.request = sbus_dma_request; chip->c_dma.request = sbus_dma_request;
chip->c_dma.address = sbus_dma_addr; chip->c_dma.address = sbus_dma_addr;
if (request_irq(op->irqs[0], snd_cs4231_sbus_interrupt, if (request_irq(op->archdata.irqs[0], snd_cs4231_sbus_interrupt,
IRQF_SHARED, "cs4231", chip)) { IRQF_SHARED, "cs4231", chip)) {
snd_printdd("cs4231-%d: Unable to grab SBUS IRQ %d\n", snd_printdd("cs4231-%d: Unable to grab SBUS IRQ %d\n",
dev, op->irqs[0]); dev, op->archdata.irqs[0]);
snd_cs4231_sbus_free(chip); snd_cs4231_sbus_free(chip);
return -EBUSY; return -EBUSY;
} }
chip->irq[0] = op->irqs[0]; chip->irq[0] = op->archdata.irqs[0];
if (snd_cs4231_probe(chip) < 0) { if (snd_cs4231_probe(chip) < 0) {
snd_cs4231_sbus_free(chip); snd_cs4231_sbus_free(chip);
@ -1870,7 +1870,7 @@ static int __devinit cs4231_sbus_probe(struct of_device *op, const struct of_dev
card->shortname, card->shortname,
rp->flags & 0xffL, rp->flags & 0xffL,
(unsigned long long)rp->start, (unsigned long long)rp->start,
op->irqs[0]); op->archdata.irqs[0]);
err = snd_cs4231_sbus_create(card, op, dev); err = snd_cs4231_sbus_create(card, op, dev);
if (err < 0) { if (err < 0) {
@ -1979,12 +1979,12 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
chip->c_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER; chip->c_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER;
chip->c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback; chip->c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback;
chip->c_dma.ebus_info.client_cookie = chip; chip->c_dma.ebus_info.client_cookie = chip;
chip->c_dma.ebus_info.irq = op->irqs[0]; chip->c_dma.ebus_info.irq = op->archdata.irqs[0];
strcpy(chip->p_dma.ebus_info.name, "cs4231(play)"); strcpy(chip->p_dma.ebus_info.name, "cs4231(play)");
chip->p_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER; chip->p_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER;
chip->p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback; chip->p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback;
chip->p_dma.ebus_info.client_cookie = chip; chip->p_dma.ebus_info.client_cookie = chip;
chip->p_dma.ebus_info.irq = op->irqs[1]; chip->p_dma.ebus_info.irq = op->archdata.irqs[1];
chip->p_dma.prepare = _ebus_dma_prepare; chip->p_dma.prepare = _ebus_dma_prepare;
chip->p_dma.enable = _ebus_dma_enable; chip->p_dma.enable = _ebus_dma_enable;
@ -2060,7 +2060,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_dev
sprintf(card->longname, "%s at 0x%llx, irq %d", sprintf(card->longname, "%s at 0x%llx, irq %d",
card->shortname, card->shortname,
op->resource[0].start, op->resource[0].start,
op->irqs[0]); op->archdata.irqs[0]);
err = snd_cs4231_ebus_create(card, op, dev); err = snd_cs4231_ebus_create(card, op, dev);
if (err < 0) { if (err < 0) {

View File

@ -2608,7 +2608,7 @@ static int __devinit dbri_probe(struct of_device *op, const struct of_device_id
return -ENOENT; return -ENOENT;
} }
irq = op->irqs[0]; irq = op->archdata.irqs[0];
if (irq <= 0) { if (irq <= 0) {
printk(KERN_ERR "DBRI-%d: No IRQ.\n", dev); printk(KERN_ERR "DBRI-%d: No IRQ.\n", dev);
return -ENODEV; return -ENODEV;