* [PATCH] next-20080218 build failure at pmac_ide_macio_attach () @ 2008-02-18 14:01 ` Kamalesh Babulal 0 siblings, 0 replies; 8+ messages in thread From: Kamalesh Babulal @ 2008-02-18 14:01 UTC (permalink / raw) To: linux-kernel; +Cc: linux-ide, linuxppc-dev, sfr, apw Hi, The next-20080218 kernel build fails on the powerpc(s) drivers/ide/ppc/pmac.c: In function ‘pmac_ide_macio_attach’: drivers/ide/ppc/pmac.c:1094: error: conversion to non-scalar type requested drivers/ide/ppc/pmac.c: In function ‘pmac_ide_pci_attach’: drivers/ide/ppc/pmac.c:1232: error: conversion to non-scalar type requested make[3]: *** [drivers/ide/ppc/pmac.o] Error 1 make[2]: *** [drivers/ide/ppc] Error 2 make[1]: *** [drivers/ide] Error 2 make: *** [drivers] Error 2 I Have tested this patch for build failure only. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> --- --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 18:41:48.000000000 +0530 +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 19:20:37.000000000 +0530 @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * int irq, rc; hw_regs_t hw; - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; @@ -1229,7 +1229,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev return -ENODEV; } - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; -- Thanks & Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] next-20080218 build failure at pmac_ide_macio_attach () @ 2008-02-18 14:01 ` Kamalesh Babulal 0 siblings, 0 replies; 8+ messages in thread From: Kamalesh Babulal @ 2008-02-18 14:01 UTC (permalink / raw) To: linux-kernel; +Cc: linux-ide, sfr, linuxppc-dev Hi, The next-20080218 kernel build fails on the powerpc(s) drivers/ide/ppc/pmac.c: In function ‘pmac_ide_macio_attach’: drivers/ide/ppc/pmac.c:1094: error: conversion to non-scalar type requested drivers/ide/ppc/pmac.c: In function ‘pmac_ide_pci_attach’: drivers/ide/ppc/pmac.c:1232: error: conversion to non-scalar type requested make[3]: *** [drivers/ide/ppc/pmac.o] Error 1 make[2]: *** [drivers/ide/ppc] Error 2 make[1]: *** [drivers/ide] Error 2 make: *** [drivers] Error 2 I Have tested this patch for build failure only. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> --- --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 18:41:48.000000000 +0530 +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 19:20:37.000000000 +0530 @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * int irq, rc; hw_regs_t hw; - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; @@ -1229,7 +1229,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev return -ENODEV; } - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; -- Thanks & Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] next-20080218 build failure at pmac_ide_macio_attach () 2008-02-18 14:01 ` Kamalesh Babulal @ 2008-02-18 14:17 ` Andreas Schwab -1 siblings, 0 replies; 8+ messages in thread From: Andreas Schwab @ 2008-02-18 14:17 UTC (permalink / raw) To: Kamalesh Babulal; +Cc: linux-kernel, linux-ide, linuxppc-dev, sfr, apw Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> writes: > --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 18:41:48.000000000 +0530 > +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 19:20:37.000000000 +0530 > @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * > int irq, rc; > hw_regs_t hw; > > - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); > + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); Just remove the cast. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] next-20080218 build failure at pmac_ide_macio_attach () @ 2008-02-18 14:17 ` Andreas Schwab 0 siblings, 0 replies; 8+ messages in thread From: Andreas Schwab @ 2008-02-18 14:17 UTC (permalink / raw) To: Kamalesh Babulal; +Cc: linux-ide, sfr, linux-kernel, linuxppc-dev Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> writes: > --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 18:41:48.000000000 +0530 > +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 19:20:37.000000000 +0530 > @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * > int irq, rc; > hw_regs_t hw; > > - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); > + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); Just remove the cast. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH-RESEND] next-20080218 build failure at pmac_ide_macio_attach () 2008-02-18 14:17 ` Andreas Schwab @ 2008-02-18 17:06 ` Kamalesh Babulal -1 siblings, 0 replies; 8+ messages in thread From: Kamalesh Babulal @ 2008-02-18 17:06 UTC (permalink / raw) To: Andreas Schwab Cc: Kamalesh Babulal, linux-kernel, linux-ide, linuxppc-dev, sfr, apw On Mon, Feb 18, 2008 at 03:17:49PM +0100, Andreas Schwab wrote: > Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> writes: > . . <snip> > Just remove the cast. > > Andreas. Resending the patch after making the changes Andreas said. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Cc: Andreas Schwab <schwab@suse.de> -- --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 22:24:49.000000000 +0530 +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 22:25:10.000000000 +0530 @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * int irq, rc; hw_regs_t hw; - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; @@ -1229,7 +1229,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev return -ENODEV; } - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; -- Thanks & Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH-RESEND] next-20080218 build failure at pmac_ide_macio_attach () @ 2008-02-18 17:06 ` Kamalesh Babulal 0 siblings, 0 replies; 8+ messages in thread From: Kamalesh Babulal @ 2008-02-18 17:06 UTC (permalink / raw) To: Andreas Schwab Cc: sfr, linux-ide, linux-kernel, Kamalesh Babulal, linuxppc-dev On Mon, Feb 18, 2008 at 03:17:49PM +0100, Andreas Schwab wrote: > Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> writes: > . . <snip> > Just remove the cast. > > Andreas. Resending the patch after making the changes Andreas said. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Cc: Andreas Schwab <schwab@suse.de> -- --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 22:24:49.000000000 +0530 +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 22:25:10.000000000 +0530 @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * int irq, rc; hw_regs_t hw; - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; @@ -1229,7 +1229,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev return -ENODEV; } - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); + pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); if (pmif == NULL) return -ENOMEM; -- Thanks & Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] next-20080218 build failure at pmac_ide_macio_attach () 2008-02-18 14:01 ` Kamalesh Babulal @ 2008-02-19 0:04 ` Bartlomiej Zolnierkiewicz -1 siblings, 0 replies; 8+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2008-02-19 0:04 UTC (permalink / raw) To: Kamalesh Babulal; +Cc: linux-kernel, linux-ide, linuxppc-dev, sfr, apw On Monday 18 February 2008, Kamalesh Babulal wrote: > Hi, > > The next-20080218 kernel build fails on the powerpc(s) > > drivers/ide/ppc/pmac.c: In function ‘pmac_ide_macio_attach’: > drivers/ide/ppc/pmac.c:1094: error: conversion to non-scalar type requested > drivers/ide/ppc/pmac.c: In function ‘pmac_ide_pci_attach’: > drivers/ide/ppc/pmac.c:1232: error: conversion to non-scalar type requested > make[3]: *** [drivers/ide/ppc/pmac.o] Error 1 > make[2]: *** [drivers/ide/ppc] Error 2 > make[1]: *** [drivers/ide] Error 2 > make: *** [drivers] Error 2 > > I Have tested this patch for build failure only. > > Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> > --- > --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 18:41:48.000000000 +0530 > +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 19:20:37.000000000 +0530 > @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * > int irq, rc; > hw_regs_t hw; > > - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); > + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); > if (pmif == NULL) > return -ENOMEM; > > @@ -1229,7 +1229,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev > return -ENODEV; > } > > - pmif = (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); > + pmif = (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); > if (pmif == NULL) > return -ENOMEM; > Thanks, I integrated it with the "guilty" patch to preserve bisectability. From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Subject: [PATCH] ide-pmac: dynamically allocate struct pmac_ide_hwif instances (take 2) * Dynamically allocate struct pmac_ide_hwif instances in pmac_ide_macio_attach() and pmac_ide_pci_attach(), then remove no longer needed pmac_ide[]. v2: * Build fix from Kamalesh Babulal. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> --- drivers/ide/ppc/pmac.c | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) Index: b/drivers/ide/ppc/pmac.c =================================================================== --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -79,8 +79,6 @@ typedef struct pmac_ide_hwif { } pmac_ide_hwif_t; -static pmac_ide_hwif_t pmac_ide[MAX_HWIFS]; - enum { controller_ohare, /* OHare based */ controller_heathrow, /* Heathrow/Paddington */ @@ -1094,29 +1092,34 @@ pmac_ide_macio_attach(struct macio_dev * int i, rc; hw_regs_t hw; + pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); + if (pmif == NULL) + return -ENOMEM; + i = 0; - while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0 - || pmac_ide[i].node != NULL)) + while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0)) ++i; if (i >= MAX_HWIFS) { printk(KERN_ERR "ide-pmac: MacIO interface attach with no slot\n"); printk(KERN_ERR " %s\n", mdev->ofdev.node->full_name); - return -ENODEV; + rc = -ENODEV; + goto out_free_pmif; } - pmif = &pmac_ide[i]; hwif = &ide_hwifs[i]; if (macio_resource_count(mdev) == 0) { printk(KERN_WARNING "ide%d: no address for %s\n", i, mdev->ofdev.node->full_name); - return -ENXIO; + rc = -ENXIO; + goto out_free_pmif; } /* Request memory resource for IO ports */ if (macio_request_resource(mdev, 0, "ide-pmac (ports)")) { printk(KERN_ERR "ide%d: can't request mmio resource !\n", i); - return -EBUSY; + rc = -EBUSY; + goto out_free_pmif; } /* XXX This is bogus. Should be fixed in the registry by checking @@ -1166,11 +1169,15 @@ pmac_ide_macio_attach(struct macio_dev * iounmap(pmif->dma_regs); macio_release_resource(mdev, 1); } - memset(pmif, 0, sizeof(*pmif)); macio_release_resource(mdev, 0); + kfree(pmif); } return rc; + +out_free_pmif: + kfree(pmif); + return rc; } static int @@ -1223,30 +1230,36 @@ pmac_ide_pci_attach(struct pci_dev *pdev printk(KERN_ERR "ide-pmac: cannot find MacIO node for Kauai ATA interface\n"); return -ENODEV; } + + pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); + if (pmif == NULL) + return -ENOMEM; + i = 0; - while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0 - || pmac_ide[i].node != NULL)) + while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0)) ++i; if (i >= MAX_HWIFS) { printk(KERN_ERR "ide-pmac: PCI interface attach with no slot\n"); printk(KERN_ERR " %s\n", np->full_name); - return -ENODEV; + rc = -ENODEV; + goto out_free_pmif; } - pmif = &pmac_ide[i]; hwif = &ide_hwifs[i]; if (pci_enable_device(pdev)) { printk(KERN_WARNING "ide%i: Can't enable PCI device for %s\n", i, np->full_name); - return -ENXIO; + rc = -ENXIO; + goto out_free_pmif; } pci_set_master(pdev); if (pci_request_regions(pdev, "Kauai ATA")) { printk(KERN_ERR "ide%d: Cannot obtain PCI resources for %s\n", i, np->full_name); - return -ENXIO; + rc = -ENXIO; + goto out_free_pmif; } hwif->dev = &pdev->dev; @@ -1276,11 +1289,15 @@ pmac_ide_pci_attach(struct pci_dev *pdev /* The inteface is released to the common IDE layer */ pci_set_drvdata(pdev, NULL); iounmap(base); - memset(pmif, 0, sizeof(*pmif)); pci_release_regions(pdev); + kfree(pmif); } return rc; + +out_free_pmif: + kfree(pmif); + return rc; } static int ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] next-20080218 build failure at pmac_ide_macio_attach () @ 2008-02-19 0:04 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 8+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2008-02-19 0:04 UTC (permalink / raw) To: Kamalesh Babulal; +Cc: linux-ide, sfr, linux-kernel, linuxppc-dev On Monday 18 February 2008, Kamalesh Babulal wrote: > Hi, >=20 > The next-20080218 kernel build fails on the powerpc(s) >=20 > drivers/ide/ppc/pmac.c: In function =E2=80=98pmac_ide_macio_attach=E2=80= =99: > drivers/ide/ppc/pmac.c:1094: error: conversion to non-scalar type request= ed > drivers/ide/ppc/pmac.c: In function =E2=80=98pmac_ide_pci_attach=E2=80=99: > drivers/ide/ppc/pmac.c:1232: error: conversion to non-scalar type request= ed > make[3]: *** [drivers/ide/ppc/pmac.o] Error 1 > make[2]: *** [drivers/ide/ppc] Error 2 > make[1]: *** [drivers/ide] Error 2 > make: *** [drivers] Error 2 >=20 > I Have tested this patch for build failure only. >=20 > Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> > --- > --- linux-2.6.25-rc1/drivers/ide/ppc/pmac.c 2008-02-18 18:41:48.000000000= +0530 > +++ linux-2.6.25-rc1/drivers/ide/ppc/~pmac.c 2008-02-18 19:20:37.00000000= 0 +0530 > @@ -1091,7 +1091,7 @@ pmac_ide_macio_attach(struct macio_dev * > int irq, rc; > hw_regs_t hw; > =20 > - pmif =3D (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); > + pmif =3D (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); > if (pmif =3D=3D NULL) > return -ENOMEM; > =20 > @@ -1229,7 +1229,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev > return -ENODEV; > } > =20 > - pmif =3D (struct pmac_ide_hwif)kzalloc(sizeof(*pmif), GFP_KERNEL); > + pmif =3D (struct pmac_ide_hwif*)kzalloc(sizeof(*pmif), GFP_KERNEL); > if (pmif =3D=3D NULL) > return -ENOMEM; > =20 Thanks, I integrated it with the "guilty" patch to preserve bisectability. =46rom: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Subject: [PATCH] ide-pmac: dynamically allocate struct pmac_ide_hwif instan= ces (take 2) * Dynamically allocate struct pmac_ide_hwif instances in pmac_ide_macio_att= ach() and pmac_ide_pci_attach(), then remove no longer needed pmac_ide[]. v2: * Build fix from Kamalesh Babulal. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> =2D-- drivers/ide/ppc/pmac.c | 49 +++++++++++++++++++++++++++++++++-----------= =2D---- 1 file changed, 33 insertions(+), 16 deletions(-) Index: b/drivers/ide/ppc/pmac.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -79,8 +79,6 @@ typedef struct pmac_ide_hwif { =09 } pmac_ide_hwif_t; =20 =2Dstatic pmac_ide_hwif_t pmac_ide[MAX_HWIFS]; =2D enum { controller_ohare, /* OHare based */ controller_heathrow, /* Heathrow/Paddington */ @@ -1094,29 +1092,34 @@ pmac_ide_macio_attach(struct macio_dev * int i, rc; hw_regs_t hw; =20 + pmif =3D kzalloc(sizeof(*pmif), GFP_KERNEL); + if (pmif =3D=3D NULL) + return -ENOMEM; + i =3D 0; =2D while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] !=3D 0 =2D || pmac_ide[i].node !=3D NULL)) + while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] !=3D 0)) ++i; if (i >=3D MAX_HWIFS) { printk(KERN_ERR "ide-pmac: MacIO interface attach with no slot\n"); printk(KERN_ERR " %s\n", mdev->ofdev.node->full_name); =2D return -ENODEV; + rc =3D -ENODEV; + goto out_free_pmif; } =20 =2D pmif =3D &pmac_ide[i]; hwif =3D &ide_hwifs[i]; =20 if (macio_resource_count(mdev) =3D=3D 0) { printk(KERN_WARNING "ide%d: no address for %s\n", i, mdev->ofdev.node->full_name); =2D return -ENXIO; + rc =3D -ENXIO; + goto out_free_pmif; } =20 /* Request memory resource for IO ports */ if (macio_request_resource(mdev, 0, "ide-pmac (ports)")) { printk(KERN_ERR "ide%d: can't request mmio resource !\n", i); =2D return -EBUSY; + rc =3D -EBUSY; + goto out_free_pmif; } =09 /* XXX This is bogus. Should be fixed in the registry by checking @@ -1166,11 +1169,15 @@ pmac_ide_macio_attach(struct macio_dev * iounmap(pmif->dma_regs); macio_release_resource(mdev, 1); } =2D memset(pmif, 0, sizeof(*pmif)); macio_release_resource(mdev, 0); + kfree(pmif); } =20 return rc; + +out_free_pmif: + kfree(pmif); + return rc; } =20 static int @@ -1223,30 +1230,36 @@ pmac_ide_pci_attach(struct pci_dev *pdev printk(KERN_ERR "ide-pmac: cannot find MacIO node for Kauai ATA interfac= e\n"); return -ENODEV; } + + pmif =3D kzalloc(sizeof(*pmif), GFP_KERNEL); + if (pmif =3D=3D NULL) + return -ENOMEM; + i =3D 0; =2D while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] !=3D 0 =2D || pmac_ide[i].node !=3D NULL)) + while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] !=3D 0)) ++i; if (i >=3D MAX_HWIFS) { printk(KERN_ERR "ide-pmac: PCI interface attach with no slot\n"); printk(KERN_ERR " %s\n", np->full_name); =2D return -ENODEV; + rc =3D -ENODEV; + goto out_free_pmif; } =20 =2D pmif =3D &pmac_ide[i]; hwif =3D &ide_hwifs[i]; =20 if (pci_enable_device(pdev)) { printk(KERN_WARNING "ide%i: Can't enable PCI device for %s\n", i, np->full_name); =2D return -ENXIO; + rc =3D -ENXIO; + goto out_free_pmif; } pci_set_master(pdev); =09 if (pci_request_regions(pdev, "Kauai ATA")) { printk(KERN_ERR "ide%d: Cannot obtain PCI resources for %s\n", i, np->full_name); =2D return -ENXIO; + rc =3D -ENXIO; + goto out_free_pmif; } =20 hwif->dev =3D &pdev->dev; @@ -1276,11 +1289,15 @@ pmac_ide_pci_attach(struct pci_dev *pdev /* The inteface is released to the common IDE layer */ pci_set_drvdata(pdev, NULL); iounmap(base); =2D memset(pmif, 0, sizeof(*pmif)); pci_release_regions(pdev); + kfree(pmif); } =20 return rc; + +out_free_pmif: + kfree(pmif); + return rc; } =20 static int ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-02-19 0:50 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-18 14:01 [PATCH] next-20080218 build failure at pmac_ide_macio_attach () Kamalesh Babulal 2008-02-18 14:01 ` Kamalesh Babulal 2008-02-18 14:17 ` Andreas Schwab 2008-02-18 14:17 ` Andreas Schwab 2008-02-18 17:06 ` [PATCH-RESEND] " Kamalesh Babulal 2008-02-18 17:06 ` Kamalesh Babulal 2008-02-19 0:04 ` [PATCH] " Bartlomiej Zolnierkiewicz 2008-02-19 0:04 ` Bartlomiej Zolnierkiewicz
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.