]> err.no Git - linux-2.6/commitdiff
ide-pmac: macio resource freeing bugfix
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 1 Feb 2008 22:09:32 +0000 (23:09 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 1 Feb 2008 22:09:32 +0000 (23:09 +0100)
Release DMA resource before zeroing pmif.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ppc/pmac.c

index b17e097650b1fec8151e2f747d7853bb2f5f4e03..f6a374a0de037f5edefede982aa063105ceb75c6 100644 (file)
@@ -1228,12 +1228,12 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
                /* The inteface is released to the common IDE layer */
                dev_set_drvdata(&mdev->ofdev.dev, NULL);
                iounmap(base);
-               if (pmif->dma_regs)
+               if (pmif->dma_regs) {
                        iounmap(pmif->dma_regs);
+                       macio_release_resource(mdev, 1);
+               }
                memset(pmif, 0, sizeof(*pmif));
                macio_release_resource(mdev, 0);
-               if (pmif->dma_regs)
-                       macio_release_resource(mdev, 1);
        }
 
        return rc;