From: YueHaibing <yuehaibing@huawei.com>
To: <alim.akhtar@samsung.com>, <avri.altman@wdc.com>,
<pedrom.sousa@synopsys.com>, <jejb@linux.ibm.com>,
<martin.petersen@oracle.com>, <stanley.chu@mediatek.com>,
<beanhuo@micron.com>, <yuehaibing@huawei.com>, <arnd@arndb.de>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] scsi: ufshcd: use devm_platform_ioremap_resource() to simplify code
Date: Wed, 4 Sep 2019 21:03:48 +0800 [thread overview]
Message-ID: <20190904130348.24772-1-yuehaibing@huawei.com> (raw)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/scsi/ufs/ufshcd-pltfrm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index d7d521b..8d40dc9 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -391,12 +391,10 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
{
struct ufs_hba *hba;
void __iomem *mmio_base;
- struct resource *mem_res;
int irq, err;
struct device *dev = &pdev->dev;
- mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- mmio_base = devm_ioremap_resource(dev, mem_res);
+ mmio_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mmio_base)) {
err = PTR_ERR(mmio_base);
goto out;
--
2.7.4
next reply other threads:[~2019-09-04 13:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 13:03 YueHaibing [this message]
2019-09-04 13:38 ` [PATCH -next] scsi: ufshcd: use devm_platform_ioremap_resource() to simplify code Avri Altman
2019-09-07 20:42 ` Martin K. Petersen
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=20190904130348.24772-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=alim.akhtar@samsung.com \
--cc=arnd@arndb.de \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=pedrom.sousa@synopsys.com \
--cc=stanley.chu@mediatek.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).