Merge tag 'iio-fixes-for-6.6b' of https://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / drivers / gpio / gpio-tb10x.c
index 78f8790..f96d260 100644 (file)
@@ -195,7 +195,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
                                handle_edge_irq, IRQ_NOREQUEST, IRQ_NOPROBE,
                                IRQ_GC_INIT_MASK_CACHE);
                if (ret)
-                       return ret;
+                       goto err_remove_domain;
 
                gc = tb10x_gpio->domain->gc->gc[0];
                gc->reg_base                         = tb10x_gpio->base;
@@ -209,6 +209,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
        }
 
        return 0;
+
+err_remove_domain:
+       irq_domain_remove(tb10x_gpio->domain);
+       return ret;
 }
 
 static int tb10x_gpio_remove(struct platform_device *pdev)