From: Bartlomiej Zolnierkiewicz Date: Fri, 1 Feb 2008 22:09:32 +0000 (+0100) Subject: ide-pmac: macio resource freeing bugfix X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ed908fa1d037d780ebd04a412693bf3fc9c3a8fe;p=linux-beck.git ide-pmac: macio resource freeing bugfix Release DMA resource before zeroing pmif. Cc: Benjamin Herrenschmidt Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index b17e097650b1..f6a374a0de03 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -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;