diff options
Diffstat (limited to 'drivers/of/irq.c')
-rw-r--r-- | drivers/of/irq.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 8cc62b4a7988..52dba6a01423 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c | |||
@@ -147,18 +147,9 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq) | |||
147 | 147 | ||
148 | pr_debug(" -> addrsize=%d\n", addrsize); | 148 | pr_debug(" -> addrsize=%d\n", addrsize); |
149 | 149 | ||
150 | /* If we were passed no "reg" property and we attempt to parse | ||
151 | * an interrupt-map, then #address-cells must be 0. | ||
152 | * Fail if it's not. | ||
153 | */ | ||
154 | if (addr == NULL && addrsize != 0) { | ||
155 | pr_debug(" -> no reg passed in when needed !\n"); | ||
156 | return -EINVAL; | ||
157 | } | ||
158 | |||
159 | /* Precalculate the match array - this simplifies match loop */ | 150 | /* Precalculate the match array - this simplifies match loop */ |
160 | for (i = 0; i < addrsize; i++) | 151 | for (i = 0; i < addrsize; i++) |
161 | initial_match_array[i] = addr[i]; | 152 | initial_match_array[i] = addr ? addr[i] : 0; |
162 | for (i = 0; i < intsize; i++) | 153 | for (i = 0; i < intsize; i++) |
163 | initial_match_array[addrsize + i] = cpu_to_be32(out_irq->args[i]); | 154 | initial_match_array[addrsize + i] = cpu_to_be32(out_irq->args[i]); |
164 | 155 | ||
@@ -174,6 +165,15 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq) | |||
174 | return 0; | 165 | return 0; |
175 | } | 166 | } |
176 | 167 | ||
168 | /* | ||
169 | * interrupt-map parsing does not work without a reg | ||
170 | * property when #address-cells != 0 | ||
171 | */ | ||
172 | if (addrsize && !addr) { | ||
173 | pr_debug(" -> no reg passed in when needed !\n"); | ||
174 | goto fail; | ||
175 | } | ||
176 | |||
177 | /* Now look for an interrupt-map */ | 177 | /* Now look for an interrupt-map */ |
178 | imap = of_get_property(ipar, "interrupt-map", &imaplen); | 178 | imap = of_get_property(ipar, "interrupt-map", &imaplen); |
179 | /* No interrupt map, check for an interrupt parent */ | 179 | /* No interrupt map, check for an interrupt parent */ |