Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c44d515 authored by Nishanth Menon's avatar Nishanth Menon Committed by Jason Cooper
Browse files

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: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarSricharan R <r.sricharan@ti.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Link: https://lkml.kernel.org/r/1403766634-18543-11-git-send-email-r.sricharan@ti.com


Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent edb442de
Loading
Loading
Loading
Loading
+11 −12
Original line number Original line Diff line number Diff line
@@ -140,17 +140,17 @@ static int __init crossbar_of_init(struct device_node *node)


	cb->crossbar_base = of_iomap(node, 0);
	cb->crossbar_base = of_iomap(node, 0);
	if (!cb->crossbar_base)
	if (!cb->crossbar_base)
		goto err1;
		goto err_cb;


	of_property_read_u32(node, "ti,max-irqs", &max);
	of_property_read_u32(node, "ti,max-irqs", &max);
	if (!max) {
	if (!max) {
		pr_err("missing 'ti,max-irqs' property\n");
		pr_err("missing 'ti,max-irqs' property\n");
		ret = -EINVAL;
		ret = -EINVAL;
		goto err2;
		goto err_base;
	}
	}
	cb->irq_map = kcalloc(max, sizeof(int), GFP_KERNEL);
	cb->irq_map = kcalloc(max, sizeof(int), GFP_KERNEL);
	if (!cb->irq_map)
	if (!cb->irq_map)
		goto err2;
		goto err_base;


	cb->int_max = max;
	cb->int_max = max;


@@ -169,7 +169,7 @@ static int __init crossbar_of_init(struct device_node *node)
			if (entry > max) {
			if (entry > max) {
				pr_err("Invalid reserved entry\n");
				pr_err("Invalid reserved entry\n");
				ret = -EINVAL;
				ret = -EINVAL;
				goto err3;
				goto err_irq_map;
			}
			}
			cb->irq_map[entry] = IRQ_RESERVED;
			cb->irq_map[entry] = IRQ_RESERVED;
		}
		}
@@ -187,7 +187,7 @@ static int __init crossbar_of_init(struct device_node *node)
			if (entry > max) {
			if (entry > max) {
				pr_err("Invalid skip entry\n");
				pr_err("Invalid skip entry\n");
				ret = -EINVAL;
				ret = -EINVAL;
				goto err3;
				goto err_irq_map;
			}
			}
			cb->irq_map[entry] = IRQ_SKIP;
			cb->irq_map[entry] = IRQ_SKIP;
		}
		}
@@ -196,7 +196,7 @@ static int __init crossbar_of_init(struct device_node *node)


	cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL);
	cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL);
	if (!cb->register_offsets)
	if (!cb->register_offsets)
		goto err3;
		goto err_irq_map;


	of_property_read_u32(node, "ti,reg-size", &size);
	of_property_read_u32(node, "ti,reg-size", &size);


@@ -213,7 +213,7 @@ static int __init crossbar_of_init(struct device_node *node)
	default:
	default:
		pr_err("Invalid reg-size property\n");
		pr_err("Invalid reg-size property\n");
		ret = -EINVAL;
		ret = -EINVAL;
		goto err4;
		goto err_reg_offset;
		break;
		break;
	}
	}


@@ -230,7 +230,6 @@ static int __init crossbar_of_init(struct device_node *node)
	}
	}


	of_property_read_u32(node, "ti,irqs-safe-map", &cb->safe_map);
	of_property_read_u32(node, "ti,irqs-safe-map", &cb->safe_map);

	/* Initialize the crossbar with safe map to start with */
	/* Initialize the crossbar with safe map to start with */
	for (i = 0; i < max; i++) {
	for (i = 0; i < max; i++) {
		if (cb->irq_map[i] == IRQ_RESERVED ||
		if (cb->irq_map[i] == IRQ_RESERVED ||
@@ -243,13 +242,13 @@ static int __init crossbar_of_init(struct device_node *node)
	register_routable_domain_ops(&routable_irq_domain_ops);
	register_routable_domain_ops(&routable_irq_domain_ops);
	return 0;
	return 0;


err4:
err_reg_offset:
	kfree(cb->register_offsets);
	kfree(cb->register_offsets);
err3:
err_irq_map:
	kfree(cb->irq_map);
	kfree(cb->irq_map);
err2:
err_base:
	iounmap(cb->crossbar_base);
	iounmap(cb->crossbar_base);
err1:
err_cb:
	kfree(cb);
	kfree(cb);
	return ret;
	return ret;
}
}