From: varkabhadram@gmail.com
To: netdev@vger.kernel.org
Cc: Thomas.Lendacky@amd.com, geert+renesas@linux-m68k.org,
ebiederm@xmission.com, macro@linux-mips.org,
linux-kernel@vger.kernel.org, davem@davemloft.net,
Varka Bhadram <varkab@cdac.in>
Subject: [PATCH net-next v2 2/6] ethernet: amd: use devm_ioremap()
Date: Mon, 14 Jul 2014 11:55:43 +0530 [thread overview]
Message-ID: <1405319147-5212-3-git-send-email-varkabhadram@gmail.com> (raw)
In-Reply-To: <1405319147-5212-1-git-send-email-varkabhadram@gmail.com>
From: Varka Bhadram <varkab@cdac.in>
This patch replace ioremap() with the devm_ioremap() so that
the resource will be freed automatically with the probe failed.
Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
drivers/net/ethernet/amd/amd8111e.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index ddd09e8..433107c 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -1866,7 +1866,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
spin_lock_init(&lp->lock);
- lp->mmio = ioremap(reg_addr, reg_len);
+ lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len);
if (!lp->mmio) {
printk(KERN_ERR "amd8111e: Cannot map device registers, "
"exiting\n");
@@ -1913,7 +1913,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
if (err) {
printk(KERN_ERR "amd8111e: Cannot register net device, "
"exiting.\n");
- goto err_iounmap;
+ goto err_free_dev;
}
pci_set_drvdata(pdev, dev);
@@ -1943,8 +1943,6 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
printk(KERN_INFO "%s: Couldn't detect MII PHY, assuming address 0x01\n",
dev->name);
return 0;
-err_iounmap:
- iounmap(lp->mmio);
err_free_dev:
free_netdev(dev);
@@ -1964,7 +1962,6 @@ static void amd8111e_remove_one(struct pci_dev *pdev)
if (dev) {
unregister_netdev(dev);
- iounmap(((struct amd8111e_priv *)netdev_priv(dev))->mmio);
free_netdev(dev);
pci_release_regions(pdev);
pci_disable_device(pdev);
--
1.7.9.5
next prev parent reply other threads:[~2014-07-14 6:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 6:25 [PATCH net-next v2 0/6] cleanup for AMD811E ethernet driver varkabhadram
2014-07-14 6:25 ` [PATCH net-next v2 1/6] ethernet: amd: move amd111e_remove_one after probe varkabhadram
2014-07-14 6:25 ` varkabhadram [this message]
2014-07-14 6:25 ` [PATCH net-next v2 3/6] ethernet: amd: dynamic debug fixes varkabhadram
2014-07-14 8:06 ` Joe Perches
2014-07-14 8:21 ` Varka Bhadram
2014-07-14 6:25 ` [PATCH net-next v2 4/6] ethernet: amd: fix comment styles varkabhadram
2014-07-14 6:25 ` [PATCH net-next v2 5/6] ethernet: amd: fix pci device ids varkabhadram
2014-07-14 17:36 ` Sergei Shtylyov
2014-07-14 6:25 ` [PATCH net-next v2 6/6] ethernet: amd: fix 'foo* bar' varkabhadram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405319147-5212-3-git-send-email-varkabhadram@gmail.com \
--to=varkabhadram@gmail.com \
--cc=Thomas.Lendacky@amd.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=geert+renesas@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=netdev@vger.kernel.org \
--cc=varkab@cdac.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).