Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964811Ab2HXOjZ (ORCPT ); Fri, 24 Aug 2012 10:39:25 -0400 Received: from mga01.intel.com ([192.55.52.88]:9488 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759544Ab2HXOjV (ORCPT ); Fri, 24 Aug 2012 10:39:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,304,1344236400"; d="asc'?scan'208,223";a="213473508" Message-ID: <1345819407.2848.319.camel@sauron.fi.intel.com> Subject: Re: [PATCH] drivers/mtd/devices/spear_smi.c: use devm_ functions consistently From: Artem Bityutskiy Reply-To: dedekind1@gmail.com To: Stefan Roese Cc: Julia Lawall , Shiraz Hashim , David Woodhouse , kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 24 Aug 2012 17:43:27 +0300 In-Reply-To: <50377E38.1040701@denx.de> References: <1344112598-1051-1-git-send-email-Julia.Lawall@lip6.fr> <1345808104.2848.285.camel@sauron.fi.intel.com> <50377E38.1040701@denx.de> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-/dTG7MKRI3+2+fkfYs+G" X-Mailer: Evolution 3.2.3 (3.2.3-3.fc16) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 17008 Lines: 418 --=-/dTG7MKRI3+2+fkfYs+G Content-Type: multipart/mixed; boundary="=-/74K4N44AkpYrLXJDpCI" --=-/74K4N44AkpYrLXJDpCI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2012-08-24 at 15:14 +0200, Stefan Roese wrote: > On 08/24/2012 01:35 PM, Artem Bityutskiy wrote: > >> @@ -1073,21 +1043,13 @@ static int __devexit spear_smi_remove(struct p= latform_device *pdev) > >> ret =3D mtd_device_unregister(&flash->mtd); > >> if (ret) > >> dev_err(&pdev->dev, "error removing mtd\n"); > >> - > >> - iounmap(flash->base_addr); > >> - kfree(flash); > >> } > >> =20 > >> irq =3D platform_get_irq(pdev, 0); > >> - free_irq(irq, dev); > >=20 > > I guess 'platform_get_irq()' should be killed as well? Stefan, this is > > strange code - we get irq, without checking for error, and then free it= ? > > What is the rationale? >=20 > Yes, this seems bogus. platform_get_irq() definitely should be removed > from spear_smi_remove(). OK, thanks, I've massaged Julia's patch and pushed the following (also attached) to l2-mtd.git, compile-tested only. =46rom d44ab8be1a01b83c744d8077a54064e179b0e2b8 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sat, 4 Aug 2012 22:36:38 +0200 Subject: [PATCH] mtd: spear_smi: use devm_ functions consistently Use devm_kzalloc for all calls to kzalloc and not just the first. Use devm functions for other allocations as well. Move the call to platform_get_resource(pdev, IORESOURCE_MEM, 0) closer to where its result is passed to devm_request_and_ioremap to make the lack of need for a NULL test more evident. The semantic match that finds the inconsistency is as follows: (http://coccinelle.lip6.fr/) // @@ @@ *devm_kzalloc(...) ... *kzalloc(...) // Signed-off-by: Julia Lawall Signed-off-by: Artem Bityutskiy --- drivers/mtd/devices/spear_smi.c | 83 +++++++++--------------------------= ---- 1 file changed, 18 insertions(+), 65 deletions(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_sm= i.c index 421bc65..dcc3c95 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -827,7 +827,7 @@ static int spear_smi_setup_banks(struct platform_device= *pdev, if (!flash_info) return -ENODEV; =20 - flash =3D kzalloc(sizeof(*flash), GFP_ATOMIC); + flash =3D devm_kzalloc(&pdev->dev, sizeof(*flash), GFP_ATOMIC); if (!flash) return -ENOMEM; flash->bank =3D bank; @@ -838,15 +838,13 @@ static int spear_smi_setup_banks(struct platform_devi= ce *pdev, flash_index =3D spear_smi_probe_flash(dev, bank); if (flash_index < 0) { dev_info(&dev->pdev->dev, "smi-nor%d not found\n", bank); - ret =3D flash_index; - goto err_probe; + return flash_index; } /* map the memory for nor flash chip */ - flash->base_addr =3D ioremap(flash_info->mem_base, flash_info->size); - if (!flash->base_addr) { - ret =3D -EIO; - goto err_probe; - } + flash->base_addr =3D devm_ioremap(&pdev->dev, flash_info->mem_base, + flash_info->size); + if (!flash->base_addr) + return -EIO; =20 dev->flash[bank] =3D flash; flash->mtd.priv =3D dev; @@ -888,17 +886,10 @@ static int spear_smi_setup_banks(struct platform_devi= ce *pdev, count); if (ret) { dev_err(&dev->pdev->dev, "Err MTD partition=3D%d\n", ret); - goto err_map; + return ret; } =20 return 0; - -err_map: - iounmap(flash->base_addr); - -err_probe: - kfree(flash); - return ret; } =20 /** @@ -942,13 +933,6 @@ static int __devinit spear_smi_probe(struct platform_d= evice *pdev) } } =20 - smi_base =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!smi_base) { - ret =3D -ENODEV; - dev_err(&pdev->dev, "invalid smi base address\n"); - goto err; - } - irq =3D platform_get_irq(pdev, 0); if (irq < 0) { ret =3D -ENODEV; @@ -956,26 +940,20 @@ static int __devinit spear_smi_probe(struct platform_= device *pdev) goto err; } =20 - dev =3D kzalloc(sizeof(*dev), GFP_ATOMIC); + dev =3D devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_ATOMIC); if (!dev) { ret =3D -ENOMEM; dev_err(&pdev->dev, "mem alloc fail\n"); goto err; } =20 - smi_base =3D request_mem_region(smi_base->start, resource_size(smi_base), - pdev->name); - if (!smi_base) { - ret =3D -EBUSY; - dev_err(&pdev->dev, "request mem region fail\n"); - goto err_mem; - } + smi_base =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); =20 - dev->io_base =3D ioremap(smi_base->start, resource_size(smi_base)); + dev->io_base =3D devm_request_and_ioremap(&pdev->dev, smi_base); if (!dev->io_base) { ret =3D -EIO; - dev_err(&pdev->dev, "ioremap fail\n"); - goto err_ioremap; + dev_err(&pdev->dev, "devm_request_and_ioremap fail\n"); + goto err; } =20 dev->pdev =3D pdev; @@ -991,17 +969,18 @@ static int __devinit spear_smi_probe(struct platform_= device *pdev) dev->num_flashes =3D MAX_NUM_FLASH_CHIP; } =20 - dev->clk =3D clk_get(&pdev->dev, NULL); + dev->clk =3D devm_clk_get(&pdev->dev, NULL); if (IS_ERR(dev->clk)) { ret =3D PTR_ERR(dev->clk); - goto err_clk; + goto err; } =20 ret =3D clk_prepare_enable(dev->clk); if (ret) - goto err_clk_prepare_enable; + goto err; =20 - ret =3D request_irq(irq, spear_smi_int_handler, 0, pdev->name, dev); + ret =3D devm_request_irq(&pdev->dev, irq, spear_smi_int_handler, 0, + pdev->name, dev); if (ret) { dev_err(&dev->pdev->dev, "SMI IRQ allocation failed\n"); goto err_irq; @@ -1024,18 +1003,9 @@ static int __devinit spear_smi_probe(struct platform= _device *pdev) return 0; =20 err_bank_setup: - free_irq(irq, dev); platform_set_drvdata(pdev, NULL); err_irq: clk_disable_unprepare(dev->clk); -err_clk_prepare_enable: - clk_put(dev->clk); -err_clk: - iounmap(dev->io_base); -err_ioremap: - release_mem_region(smi_base->start, resource_size(smi_base)); -err_mem: - kfree(dev); err: return ret; } @@ -1049,11 +1019,8 @@ err: static int __devexit spear_smi_remove(struct platform_device *pdev) { struct spear_smi *dev; - struct spear_smi_plat_data *pdata; struct spear_snor_flash *flash; - struct resource *smi_base; - int ret; - int i, irq; + int ret, i; =20 dev =3D platform_get_drvdata(pdev); if (!dev) { @@ -1061,8 +1028,6 @@ static int __devexit spear_smi_remove(struct platform= _device *pdev) return -ENODEV; } =20 - pdata =3D dev_get_platdata(&pdev->dev); - /* clean up for all nor flash */ for (i =3D 0; i < dev->num_flashes; i++) { flash =3D dev->flash[i]; @@ -1073,21 +1038,9 @@ static int __devexit spear_smi_remove(struct platfor= m_device *pdev) ret =3D mtd_device_unregister(&flash->mtd); if (ret) dev_err(&pdev->dev, "error removing mtd\n"); - - iounmap(flash->base_addr); - kfree(flash); } =20 - irq =3D platform_get_irq(pdev, 0); - free_irq(irq, dev); - clk_disable_unprepare(dev->clk); - clk_put(dev->clk); - iounmap(dev->io_base); - kfree(dev); - - smi_base =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(smi_base->start, resource_size(smi_base)); platform_set_drvdata(pdev, NULL); =20 return 0; --=20 1.7.10.4 --=20 Best Regards, Artem Bityutskiy --=-/74K4N44AkpYrLXJDpCI Content-Disposition: attachment; filename="0001-mtd-spear_smi-use-devm_-functions-consistently.patch" Content-Type: text/x-patch; name="0001-mtd-spear_smi-use-devm_-functions-consistently.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJvbSBkNDRhYjhiZTFhMDFiODNjNzQ0ZDgwNzdhNTQwNjRlMTc5YjBlMmI4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQ0KRnJvbTogSnVsaWEgTGF3YWxsIDxKdWxpYS5MYXdhbGxAbGlwNi5mcj4N CkRhdGU6IFNhdCwgNCBBdWcgMjAxMiAyMjozNjozOCArMDIwMA0KU3ViamVjdDogW1BBVENIXSBt dGQ6IHNwZWFyX3NtaTogdXNlIGRldm1fIGZ1bmN0aW9ucyBjb25zaXN0ZW50bHkNCg0KVXNlIGRl dm1fa3phbGxvYyBmb3IgYWxsIGNhbGxzIHRvIGt6YWxsb2MgYW5kIG5vdCBqdXN0IHRoZSBmaXJz dC4gIFVzZSBkZXZtDQpmdW5jdGlvbnMgZm9yIG90aGVyIGFsbG9jYXRpb25zIGFzIHdlbGwuDQoN Ck1vdmUgdGhlIGNhbGwgdG8gcGxhdGZvcm1fZ2V0X3Jlc291cmNlKHBkZXYsIElPUkVTT1VSQ0Vf TUVNLCAwKSBjbG9zZXIgdG8NCndoZXJlIGl0cyByZXN1bHQgaXMgcGFzc2VkIHRvIGRldm1fcmVx dWVzdF9hbmRfaW9yZW1hcCB0byBtYWtlIHRoZSBsYWNrIG9mDQpuZWVkIGZvciBhIE5VTEwgdGVz dCBtb3JlIGV2aWRlbnQuDQoN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0KDQo= --=-/74K4N44AkpYrLXJDpCI-- --=-/dTG7MKRI3+2+fkfYs+G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJQN5MPAAoJECmIfjd9wqK0a8MQAItWdhIIBdtKpmdLgZOkIt6Z LuWGAfdZ7ulpa33pL4j13I+++FCmVYty97lO4Ph1GApghxDlUMfqYdKkbPG2iMI0 5L0/gxqK0mduiM4JAlEi9UaftB6EOOdry8SS3zmpD8niu16Nje+2EImcqZawYYX5 RB3wpSlzqnrs+9gJQLizcSnB863t9JnqOLZOnKwwcSdlvUA/GDH8Ja2YM3Iqm1po eJLyye7Z44ViB0/maY7gwUJIA5tiSKXcyK4YqyaeVUd102m5QN6aYHey1+SlrLN+ KBkOJZH10Bkji7Ot6r+PJU8k/d3b3OnsCOjIYJOj/01q/bM8vJHj3UIazjJTyEle wKjTMj1Y5kC0MRHcvJ8shrF750A0iwlE3ar4kzC/bqkzxWFHYeEJ+IbnROwX7u7C rz5bSGjg0J1mFa6aNFQET+eas3wJShV/wLtS1MaJnp6cHUdXi5vfgdd6aZUBUa3P K7dmXyn0CQn91zhyugsjWtcsf6ajY0xAuSpTypAS2kTFMn58L5WDQXT4h254dPPS QylxdpjGRdITqDaEuAXlwBz/3TT4F1/TeHrqDCZCWjXIs3jq/sjQWqqEWXYOhCNg 1w5ahXCyaflxAP6Th8Evz1CTjcbsAFL5B7IeB6yoycSc1gawiVhIAf4OZxvt6nA7 IWtmc3T41/YN6Pj3v4hs =F4/D -----END PGP SIGNATURE----- --=-/dTG7MKRI3+2+fkfYs+G-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/