ide-pmac: macio resource freeing bugfix

Release DMA resource before zeroing pmif.

Cc: Benjamin Herrenschmidt <>
Acked-by: default avatarSergei Shtylyov <>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <>
parent ed1f7889
......@@ -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->, NULL);
if (pmif->dma_regs)
if (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;
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