From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>
Subject: [PATCH 1/7] usb: mtu3: convert to devm_platform_ioremap_resource_byname
Date: Wed, 22 Jul 2020 15:51:09 +0800 [thread overview]
Message-ID: <1595404275-8449-1-git-send-email-chunfeng.yun@mediatek.com> (raw)
Use devm_platform_ioremap_resource_byname() to simplify code
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/mtu3/mtu3_core.c | 4 +---
drivers/usb/mtu3/mtu3_plat.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index 9dd0216..ca48089 100644
--- a/drivers/usb/mtu3/mtu3_core.c
+++ b/drivers/usb/mtu3/mtu3_core.c
@@ -828,7 +828,6 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
struct device *dev = ssusb->dev;
struct platform_device *pdev = to_platform_device(dev);
struct mtu3 *mtu = NULL;
- struct resource *res;
int ret = -ENOMEM;
mtu = devm_kzalloc(dev, sizeof(struct mtu3), GFP_KERNEL);
@@ -840,8 +839,7 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
return mtu->irq;
dev_info(dev, "irq %d\n", mtu->irq);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac");
- mtu->mac_base = devm_ioremap_resource(dev, res);
+ mtu->mac_base = devm_platform_ioremap_resource_byname(pdev, "mac");
if (IS_ERR(mtu->mac_base)) {
dev_err(dev, "error mapping memory for dev mac\n");
return PTR_ERR(mtu->mac_base);
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 9c256ea..d44d541 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -216,7 +216,6 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
struct device_node *node = pdev->dev.of_node;
struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
struct device *dev = &pdev->dev;
- struct resource *res;
int i;
int ret;
@@ -263,8 +262,7 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
}
}
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ippc");
- ssusb->ippc_base = devm_ioremap_resource(dev, res);
+ ssusb->ippc_base = devm_platform_ioremap_resource_byname(pdev, "ippc");
if (IS_ERR(ssusb->ippc_base))
return PTR_ERR(ssusb->ippc_base);
--
1.9.1
next reply other threads:[~2020-07-22 7:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 7:51 Chunfeng Yun [this message]
2020-07-22 7:51 ` [PATCH 2/7] usb: phy: am335x: convert to devm_platform_ioremap_resource_byname Chunfeng Yun
2020-07-22 7:51 ` [PATCH 3/7] usb: cdns3: " Chunfeng Yun
2020-07-22 8:46 ` Peter Chen
2020-07-22 7:51 ` [PATCH 4/7] usb: dwc3: " Chunfeng Yun
2020-07-27 12:55 ` Patrice CHOTARD
2020-07-22 7:51 ` [PATCH 5/7] usb: gadget: r8a66597: " Chunfeng Yun
2020-07-22 7:51 ` [PATCH 6/7] usb: gadget: tegra-xudc: " Chunfeng Yun
2020-07-22 7:51 ` [PATCH 7/7] usb: musb: " Chunfeng Yun
2020-11-12 14:08 ` Geert Uytterhoeven
2020-11-13 8:26 ` Chunfeng Yun
2020-09-07 7:42 ` [PATCH 1/7] usb: mtu3: " Felipe Balbi
2020-09-18 3:38 ` Chunfeng Yun
2020-09-24 7:20 ` Felipe Balbi
2020-09-24 8:58 ` Chunfeng Yun
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=1595404275-8449-1-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=matthias.bgg@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;
as well as URLs for NNTP newsgroup(s).