From: Markus Elfring <Markus.Elfring@web.de>
To: devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
"Antti Keränen" <detegr@gmail.com>,
"Emanuel Bennici" <benniciemanuel78@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Neil Brown" <neil@brown.name>,
"Sergio Paracuellos" <sergio.paracuellos@gmail.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Himanshu Jha <himanshujha199640@gmail.com>
Subject: [PATCH] staging: mt7621-pci-phy: Use devm_platform_ioremap_resource() in mt7621_pci_phy_probe()
Date: Wed, 18 Sep 2019 21:12:48 +0200 [thread overview]
Message-ID: <1c16a43c-3a01-8a86-02b0-1941ab7321dd@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 18 Sep 2019 21:01:32 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c b/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c
index d2a07f145143..6ca4a33d13c3 100644
--- a/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c
+++ b/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c
@@ -324,7 +324,6 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev)
const struct soc_device_attribute *attr;
struct phy_provider *provider;
struct mt7621_pci_phy *phy;
- struct resource *res;
int port;
void __iomem *port_base;
@@ -344,14 +343,7 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev)
phy->dev = dev;
platform_set_drvdata(pdev, phy);
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "failed to get address resource\n");
- return -ENXIO;
- }
-
- port_base = devm_ioremap_resource(dev, res);
+ port_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(port_base)) {
dev_err(dev, "failed to remap phy regs\n");
return PTR_ERR(port_base);
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-09-18 19:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 19:12 Markus Elfring [this message]
2019-09-19 4:20 ` [PATCH] staging: mt7621-pci-phy: Use devm_platform_ioremap_resource() in mt7621_pci_phy_probe() Sergio Paracuellos
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=1c16a43c-3a01-8a86-02b0-1941ab7321dd@web.de \
--to=markus.elfring@web.de \
--cc=benniciemanuel78@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=detegr@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=himanshujha199640@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=neil@brown.name \
--cc=sergio.paracuellos@gmail.com \
/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