diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-12-29 00:43:51 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-31 17:06:07 -0500 |
commit | f4060c0dbbe9ad7b8c0aeefa142398c8d3468bac (patch) | |
tree | 171f560c3cf14a034e8c3cf46734f4ac6fca3452 /arch/sparc64 | |
parent | 55d0bef587aa438fe5e8bed2ecce8611ebcd4c1a (diff) |
[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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/isa.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c index ad1c4f55420f..98721a8f8619 100644 --- a/arch/sparc64/kernel/isa.c +++ b/arch/sparc64/kernel/isa.c | |||
@@ -22,14 +22,15 @@ static void __init report_dev(struct sparc_isa_device *isa_dev, int child) | |||
22 | printk(" [%s", isa_dev->prom_node->name); | 22 | printk(" [%s", isa_dev->prom_node->name); |
23 | } | 23 | } |
24 | 24 | ||
25 | static struct linux_prom_registers * __init | 25 | static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev) |
26 | isa_dev_get_resource(struct sparc_isa_device *isa_dev) | ||
27 | { | 26 | { |
28 | struct linux_prom_registers *pregs; | 27 | struct linux_prom_registers *pregs; |
29 | unsigned long base, len; | 28 | unsigned long base, len; |
30 | int prop_len; | 29 | int prop_len; |
31 | 30 | ||
32 | pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len); | 31 | pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len); |
32 | if (!pregs) | ||
33 | return; | ||
33 | 34 | ||
34 | /* Only the first one is interesting. */ | 35 | /* Only the first one is interesting. */ |
35 | len = pregs[0].reg_size; | 36 | len = pregs[0].reg_size; |
@@ -44,12 +45,9 @@ isa_dev_get_resource(struct sparc_isa_device *isa_dev) | |||
44 | 45 | ||
45 | request_resource(&isa_dev->bus->parent->io_space, | 46 | request_resource(&isa_dev->bus->parent->io_space, |
46 | &isa_dev->resource); | 47 | &isa_dev->resource); |
47 | |||
48 | return pregs; | ||
49 | } | 48 | } |
50 | 49 | ||
51 | static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev, | 50 | static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev) |
52 | struct linux_prom_registers *pregs) | ||
53 | { | 51 | { |
54 | struct of_device *op = of_find_device_by_node(isa_dev->prom_node); | 52 | struct of_device *op = of_find_device_by_node(isa_dev->prom_node); |
55 | 53 | ||
@@ -69,7 +67,6 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev) | |||
69 | 67 | ||
70 | printk(" ->"); | 68 | printk(" ->"); |
71 | while (dp) { | 69 | while (dp) { |
72 | struct linux_prom_registers *regs; | ||
73 | struct sparc_isa_device *isa_dev; | 70 | struct sparc_isa_device *isa_dev; |
74 | 71 | ||
75 | isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); | 72 | 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 | isa_dev->bus = parent_isa_dev->bus; | 82 | isa_dev->bus = parent_isa_dev->bus; |
86 | isa_dev->prom_node = dp; | 83 | isa_dev->prom_node = dp; |
87 | 84 | ||
88 | regs = isa_dev_get_resource(isa_dev); | 85 | isa_dev_get_resource(isa_dev); |
89 | isa_dev_get_irq(isa_dev, regs); | 86 | isa_dev_get_irq(isa_dev); |
90 | 87 | ||
91 | report_dev(isa_dev, 1); | 88 | report_dev(isa_dev, 1); |
92 | 89 | ||
@@ -99,7 +96,6 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) | |||
99 | struct device_node *dp = isa_br->prom_node->child; | 96 | struct device_node *dp = isa_br->prom_node->child; |
100 | 97 | ||
101 | while (dp) { | 98 | while (dp) { |
102 | struct linux_prom_registers *regs; | ||
103 | struct sparc_isa_device *isa_dev; | 99 | struct sparc_isa_device *isa_dev; |
104 | 100 | ||
105 | isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); | 101 | 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 | isa_dev->bus = isa_br; | 133 | isa_dev->bus = isa_br; |
138 | isa_dev->prom_node = dp; | 134 | isa_dev->prom_node = dp; |
139 | 135 | ||
140 | regs = isa_dev_get_resource(isa_dev); | 136 | isa_dev_get_resource(isa_dev); |
141 | isa_dev_get_irq(isa_dev, regs); | 137 | isa_dev_get_irq(isa_dev); |
142 | 138 | ||
143 | report_dev(isa_dev, 0); | 139 | report_dev(isa_dev, 0); |
144 | 140 | ||