Message ID | 1336423897-31729-1-git-send-email-jkrzyszt@tis.icnet.pl |
---|---|
State | New, archived |
Headers | show |
On Mon, 2012-05-07 at 22:51 +0200, Janusz Krzysztofik wrote: > A call to request_mem_region() has been introduced in the omap-gpio > driver recently (commit 96751fcbe5438e95514b025e9cee7a6d38038f40, > "gpio/omap: Use devm_ API and add request_mem_region"). This change > prevented the Amstrad Delta NAND driver, which was doing the same in > order to take control over OMAP MPU I/O lines that the NAND device hangs > off, from loading successfully. Aiaiai found out that your patch adds this gcc warning: -------------------------------------------------------------------------------- Successfully built configuration "l2_omap1_defconfig,arm,arm-unknown-linux-gnueabi-", results: --- before_patching.log +++ after_patching.log @@ @@ +drivers/mtd/nand/ams-delta.c: In function 'ams_delta_cleanup': +drivers/mtd/nand/ams-delta.c:285:19: warning: unused variable 'res' [-Wunused-variable] --------------------------------------------------------------------------------
On Tue, 2012-05-08 at 10:03 +0300, Artem Bityutskiy wrote: > On Mon, 2012-05-07 at 22:51 +0200, Janusz Krzysztofik wrote: > > A call to request_mem_region() has been introduced in the omap-gpio > > driver recently (commit 96751fcbe5438e95514b025e9cee7a6d38038f40, > > "gpio/omap: Use devm_ API and add request_mem_region"). This change > > prevented the Amstrad Delta NAND driver, which was doing the same in > > order to take control over OMAP MPU I/O lines that the NAND device hangs > > off, from loading successfully. > > Aiaiai found out that your patch adds this gcc warning: > > -------------------------------------------------------------------------------- > > Successfully built configuration "l2_omap1_defconfig,arm,arm-unknown-linux-gnueabi-", results: > > --- before_patching.log > +++ after_patching.log > @@ @@ > +drivers/mtd/nand/ams-delta.c: In function 'ams_delta_cleanup': > +drivers/mtd/nand/ams-delta.c:285:19: warning: unused variable 'res' [-Wunused-variable] > > -------------------------------------------------------------------------------- But I've fixed this up and pushed to l2-mtd.git. From the commit message I have an impression that you are not going to implement that longer term plan. Dunno if Tony has a plan to force someone to do this by blocking some changes which are not urgent fixes. Hmm? :-)
Dnia wtorek, 8 maja 2012 10:11:46 Artem Bityutskiy pisze: > On Tue, 2012-05-08 at 10:03 +0300, Artem Bityutskiy wrote: > > On Mon, 2012-05-07 at 22:51 +0200, Janusz Krzysztofik wrote: > > > A call to request_mem_region() has been introduced in the omap- gpio > > > driver recently (commit 96751fcbe5438e95514b025e9cee7a6d38038f40, > > > "gpio/omap: Use devm_ API and add request_mem_region"). This change > > > prevented the Amstrad Delta NAND driver, which was doing the same in > > > order to take control over OMAP MPU I/O lines that the NAND device hangs > > > off, from loading successfully. > > > > Aiaiai found out that your patch adds this gcc warning: > > > > -------------------------------------------------------------------------------- > > > > Successfully built configuration "l2_omap1_defconfig,arm,arm-unknown- linux-gnueabi-", results: > > > > --- before_patching.log > > +++ after_patching.log > > @@ @@ > > +drivers/mtd/nand/ams-delta.c: In function 'ams_delta_cleanup': > > +drivers/mtd/nand/ams-delta.c:285:19: warning: unused variable 'res' [-Wunused-variable] > > > > -------------------------------------------------------------------------------- > > But I've fixed this up and pushed to l2-mtd.git. Many thanks for this. > From the commit message > I have an impression that you are not going to implement that longer > term plan. I just didn't state 'I'll do it for the next merge window' because my spare time resources are limited, and I've at least one set of changes to the Amstrad Delta code still waiting on my todo list. I'll try to implement that long term plan as my spare time permits. Thanks, Janusz
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index 7341695..358162a 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c @@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev) /* Link the private data with the MTD structure */ ams_delta_mtd->priv = this; - if (!request_mem_region(res->start, resource_size(res), - dev_name(&pdev->dev))) { - dev_err(&pdev->dev, "request_mem_region failed\n"); - err = -EBUSY; - goto out_free; - } + /* + * Don't try to request the memory region from here, + * it should have been already requested from the + * gpio-omap driver and requesting it again would fail. + */ io_base = ioremap(res->start, resource_size(res)); if (io_base == NULL) { dev_err(&pdev->dev, "ioremap failed\n"); err = -EIO; - goto out_release_io; + goto out_free; } this->priv = io_base; @@ -271,8 +270,6 @@ out_gpio: platform_set_drvdata(pdev, NULL); gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); iounmap(io_base); -out_release_io: - release_mem_region(res->start, resource_size(res)); out_free: kfree(ams_delta_mtd); out: @@ -293,7 +290,6 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev) gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); iounmap(io_base); - release_mem_region(res->start, resource_size(res)); /* Free the MTD device structure */ kfree(ams_delta_mtd);