diff options
| author | Nishanth Menon <nm@ti.com> | 2014-06-26 03:10:28 -0400 |
|---|---|---|
| committer | Jason Cooper <jason@lakedaemon.net> | 2014-06-30 15:11:24 -0400 |
| commit | 3c44d5151246947442f2fe8eede842e3f76dd2f1 (patch) | |
| tree | d4345a5867818a1f3da6e0f20b0c2d52ec7d10c1 | |
| parent | edb442def98c3c64acc316b6b1a64791c138ab07 (diff) | |
irqchip: crossbar: Change the goto naming
Using err1,2,3,4 etc makes it hard to ensure a new exit path in the
middle will not result in spurious changes, so rename the error paths
as per the function it does.
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Link: https://lkml.kernel.org/r/1403766634-18543-11-git-send-email-r.sricharan@ti.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| -rw-r--r-- | drivers/irqchip/irq-crossbar.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index 10d723dfa348..afc35fd1d9aa 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c | |||
| @@ -140,17 +140,17 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 140 | 140 | ||
| 141 | cb->crossbar_base = of_iomap(node, 0); | 141 | cb->crossbar_base = of_iomap(node, 0); |
| 142 | if (!cb->crossbar_base) | 142 | if (!cb->crossbar_base) |
| 143 | goto err1; | 143 | goto err_cb; |
| 144 | 144 | ||
| 145 | of_property_read_u32(node, "ti,max-irqs", &max); | 145 | of_property_read_u32(node, "ti,max-irqs", &max); |
| 146 | if (!max) { | 146 | if (!max) { |
| 147 | pr_err("missing 'ti,max-irqs' property\n"); | 147 | pr_err("missing 'ti,max-irqs' property\n"); |
| 148 | ret = -EINVAL; | 148 | ret = -EINVAL; |
| 149 | goto err2; | 149 | goto err_base; |
| 150 | } | 150 | } |
| 151 | cb->irq_map = kcalloc(max, sizeof(int), GFP_KERNEL); | 151 | cb->irq_map = kcalloc(max, sizeof(int), GFP_KERNEL); |
| 152 | if (!cb->irq_map) | 152 | if (!cb->irq_map) |
| 153 | goto err2; | 153 | goto err_base; |
| 154 | 154 | ||
| 155 | cb->int_max = max; | 155 | cb->int_max = max; |
| 156 | 156 | ||
| @@ -169,7 +169,7 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 169 | if (entry > max) { | 169 | if (entry > max) { |
| 170 | pr_err("Invalid reserved entry\n"); | 170 | pr_err("Invalid reserved entry\n"); |
| 171 | ret = -EINVAL; | 171 | ret = -EINVAL; |
| 172 | goto err3; | 172 | goto err_irq_map; |
| 173 | } | 173 | } |
| 174 | cb->irq_map[entry] = IRQ_RESERVED; | 174 | cb->irq_map[entry] = IRQ_RESERVED; |
| 175 | } | 175 | } |
| @@ -187,7 +187,7 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 187 | if (entry > max) { | 187 | if (entry > max) { |
| 188 | pr_err("Invalid skip entry\n"); | 188 | pr_err("Invalid skip entry\n"); |
| 189 | ret = -EINVAL; | 189 | ret = -EINVAL; |
| 190 | goto err3; | 190 | goto err_irq_map; |
| 191 | } | 191 | } |
| 192 | cb->irq_map[entry] = IRQ_SKIP; | 192 | cb->irq_map[entry] = IRQ_SKIP; |
| 193 | } | 193 | } |
| @@ -196,7 +196,7 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 196 | 196 | ||
| 197 | cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL); | 197 | cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL); |
| 198 | if (!cb->register_offsets) | 198 | if (!cb->register_offsets) |
| 199 | goto err3; | 199 | goto err_irq_map; |
| 200 | 200 | ||
| 201 | of_property_read_u32(node, "ti,reg-size", &size); | 201 | of_property_read_u32(node, "ti,reg-size", &size); |
| 202 | 202 | ||
| @@ -213,7 +213,7 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 213 | default: | 213 | default: |
| 214 | pr_err("Invalid reg-size property\n"); | 214 | pr_err("Invalid reg-size property\n"); |
| 215 | ret = -EINVAL; | 215 | ret = -EINVAL; |
| 216 | goto err4; | 216 | goto err_reg_offset; |
| 217 | break; | 217 | break; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| @@ -230,7 +230,6 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | of_property_read_u32(node, "ti,irqs-safe-map", &cb->safe_map); | 232 | of_property_read_u32(node, "ti,irqs-safe-map", &cb->safe_map); |
| 233 | |||
| 234 | /* Initialize the crossbar with safe map to start with */ | 233 | /* Initialize the crossbar with safe map to start with */ |
| 235 | for (i = 0; i < max; i++) { | 234 | for (i = 0; i < max; i++) { |
| 236 | if (cb->irq_map[i] == IRQ_RESERVED || | 235 | if (cb->irq_map[i] == IRQ_RESERVED || |
| @@ -243,13 +242,13 @@ static int __init crossbar_of_init(struct device_node *node) | |||
| 243 | register_routable_domain_ops(&routable_irq_domain_ops); | 242 | register_routable_domain_ops(&routable_irq_domain_ops); |
| 244 | return 0; | 243 | return 0; |
| 245 | 244 | ||
| 246 | err4: | 245 | err_reg_offset: |
| 247 | kfree(cb->register_offsets); | 246 | kfree(cb->register_offsets); |
| 248 | err3: | 247 | err_irq_map: |
| 249 | kfree(cb->irq_map); | 248 | kfree(cb->irq_map); |
| 250 | err2: | 249 | err_base: |
| 251 | iounmap(cb->crossbar_base); | 250 | iounmap(cb->crossbar_base); |
| 252 | err1: | 251 | err_cb: |
| 253 | kfree(cb); | 252 | kfree(cb); |
| 254 | return ret; | 253 | return ret; |
| 255 | } | 254 | } |
