Commit f4060c0d authored by David S. Miller's avatar David S. Miller

[SPARC64]: Handle ISA devices with no 'regs' property.

And this points out that the return value from
isa_dev_get_resource() and the 'pregs' arg to
isa_dev_get_irq() are totally unused.

Based upon a patch from Richard Mortimer <richm@oldelvet.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55d0bef5
...@@ -22,14 +22,15 @@ static void __init report_dev(struct sparc_isa_device *isa_dev, int child) ...@@ -22,14 +22,15 @@ static void __init report_dev(struct sparc_isa_device *isa_dev, int child)
printk(" [%s", isa_dev->prom_node->name); printk(" [%s", isa_dev->prom_node->name);
} }
static struct linux_prom_registers * __init static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev)
isa_dev_get_resource(struct sparc_isa_device *isa_dev)
{ {
struct linux_prom_registers *pregs; struct linux_prom_registers *pregs;
unsigned long base, len; unsigned long base, len;
int prop_len; int prop_len;
pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len); pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len);
if (!pregs)
return;
/* Only the first one is interesting. */ /* Only the first one is interesting. */
len = pregs[0].reg_size; len = pregs[0].reg_size;
...@@ -44,12 +45,9 @@ isa_dev_get_resource(struct sparc_isa_device *isa_dev) ...@@ -44,12 +45,9 @@ isa_dev_get_resource(struct sparc_isa_device *isa_dev)
request_resource(&isa_dev->bus->parent->io_space, request_resource(&isa_dev->bus->parent->io_space,
&isa_dev->resource); &isa_dev->resource);
return pregs;
} }
static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev, static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev)
struct linux_prom_registers *pregs)
{ {
struct of_device *op = of_find_device_by_node(isa_dev->prom_node); struct of_device *op = of_find_device_by_node(isa_dev->prom_node);
...@@ -69,7 +67,6 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev) ...@@ -69,7 +67,6 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev)
printk(" ->"); printk(" ->");
while (dp) { while (dp) {
struct linux_prom_registers *regs;
struct sparc_isa_device *isa_dev; struct sparc_isa_device *isa_dev;
isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
...@@ -85,8 +82,8 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev) ...@@ -85,8 +82,8 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev)
isa_dev->bus = parent_isa_dev->bus; isa_dev->bus = parent_isa_dev->bus;
isa_dev->prom_node = dp; isa_dev->prom_node = dp;
regs = isa_dev_get_resource(isa_dev); isa_dev_get_resource(isa_dev);
isa_dev_get_irq(isa_dev, regs); isa_dev_get_irq(isa_dev);
report_dev(isa_dev, 1); report_dev(isa_dev, 1);
...@@ -99,7 +96,6 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) ...@@ -99,7 +96,6 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
struct device_node *dp = isa_br->prom_node->child; struct device_node *dp = isa_br->prom_node->child;
while (dp) { while (dp) {
struct linux_prom_registers *regs;
struct sparc_isa_device *isa_dev; struct sparc_isa_device *isa_dev;
isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
...@@ -137,8 +133,8 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) ...@@ -137,8 +133,8 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
isa_dev->bus = isa_br; isa_dev->bus = isa_br;
isa_dev->prom_node = dp; isa_dev->prom_node = dp;
regs = isa_dev_get_resource(isa_dev); isa_dev_get_resource(isa_dev);
isa_dev_get_irq(isa_dev, regs); isa_dev_get_irq(isa_dev);
report_dev(isa_dev, 0); report_dev(isa_dev, 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