Commit 879fe324 authored by Jon Hunter's avatar Jon Hunter Committed by Linus Walleij

gpio/omap: free irq domain in probe() failure paths

Currently the IRQ domain is not freed once allocated, in the case where
omap_gpio_probe() fails. Therefore, ensure we free the domain if the
probe does fail. Furthermore, the local variable "ret" is not needed
and so remove this.
Signed-off-by: default avatarJon Hunter <>
Acked-by: default avatarSantosh Shilimkar <>
Reviewed-by: default avatarKevin Hilman <>
Signed-off-by: Linus Walleij's avatarLinus Walleij <>
parent 2b78f1e1
......@@ -1094,7 +1094,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
const struct omap_gpio_platform_data *pdata;
struct resource *res;
struct gpio_bank *bank;
int ret = 0;
match = of_match_device(of_match_ptr(omap_gpio_match), dev);
......@@ -1143,18 +1142,21 @@ static int omap_gpio_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (unlikely(!res)) {
dev_err(dev, "Invalid mem resource\n");
return -ENODEV;
if (!devm_request_mem_region(dev, res->start, resource_size(res),
pdev->name)) {
dev_err(dev, "Region already claimed\n");
return -EBUSY;
bank->base = devm_ioremap(dev, res->start, resource_size(res));
if (!bank->base) {
dev_err(dev, "Could not ioremap\n");
return -ENOMEM;
......@@ -1178,7 +1180,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
list_add_tail(&bank->node, &omap_gpio_list);
return ret;
return 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