@@ -624,7 +624,7 @@ static int omap_dmm_probe(struct platform_device *dev)
omap_dmm = kzalloc(sizeof(*omap_dmm), GFP_KERNEL);
if (!omap_dmm)
- goto fail;
+ goto check_dmm_removal;
/* initialize lists */
INIT_LIST_HEAD(&omap_dmm->alloc_head);
@@ -648,20 +648,20 @@ static int omap_dmm_probe(struct platform_device *dev)
mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!mem) {
dev_err(&dev->dev, "failed to get base address resource\n");
- goto fail;
+ goto check_dmm_removal;
}
omap_dmm->base = ioremap(mem->start, SZ_2K);
if (!omap_dmm->base) {
dev_err(&dev->dev, "failed to get dmm base address\n");
- goto fail;
+ goto check_dmm_removal;
}
omap_dmm->irq = platform_get_irq(dev, 0);
if (omap_dmm->irq < 0) {
dev_err(&dev->dev, "failed to get IRQ resource\n");
- goto fail;
+ goto check_dmm_removal;
}
omap_dmm->dev = &dev->dev;
@@ -699,7 +699,7 @@ static int omap_dmm_probe(struct platform_device *dev)
dev_err(&dev->dev, "couldn't register IRQ %d, error %d\n",
omap_dmm->irq, ret);
omap_dmm->irq = -1;
- goto fail;
+ goto check_dmm_removal;
}
/* Enable all interrupts for each refill engine except
@@ -714,13 +714,13 @@ static int omap_dmm_probe(struct platform_device *dev)
if (!omap_dmm->dummy_page) {
dev_err(&dev->dev, "could not allocate dummy page\n");
ret = -ENOMEM;
- goto fail;
+ goto check_dmm_removal;
}
/* set dma mask for device */
ret = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
if (ret)
- goto fail;
+ goto check_dmm_removal;
omap_dmm->dummy_pa = page_to_phys(omap_dmm->dummy_page);
@@ -730,7 +730,7 @@ static int omap_dmm_probe(struct platform_device *dev)
&omap_dmm->refill_pa, GFP_KERNEL);
if (!omap_dmm->refill_va) {
dev_err(&dev->dev, "could not allocate refill memory\n");
- goto fail;
+ goto check_dmm_removal;
}
/* alloc engines */
@@ -739,7 +739,7 @@ static int omap_dmm_probe(struct platform_device *dev)
GFP_KERNEL);
if (!omap_dmm->engines) {
ret = -ENOMEM;
- goto fail;
+ goto check_dmm_removal;
}
for (i = 0; i < omap_dmm->num_engines; i++) {
@@ -758,7 +758,7 @@ static int omap_dmm_probe(struct platform_device *dev)
GFP_KERNEL);
if (!omap_dmm->tcm) {
ret = -ENOMEM;
- goto fail;
+ goto check_dmm_removal;
}
/* init containers */
@@ -772,7 +772,7 @@ static int omap_dmm_probe(struct platform_device *dev)
if (!omap_dmm->tcm[i]) {
dev_err(&dev->dev, "failed to allocate container\n");
ret = -ENOMEM;
- goto fail;
+ goto check_dmm_removal;
}
omap_dmm->tcm[i]->lut_id = i;
@@ -812,8 +812,7 @@ static int omap_dmm_probe(struct platform_device *dev)
dev_info(omap_dmm->dev, "initialized all PAT entries\n");
return 0;
-
-fail:
+ check_dmm_removal:
if (omap_dmm_remove(dev))
dev_err(&dev->dev, "cleanup failed\n");
return ret;