Commit 7ce5eed0 authored by YueHaibing's avatar YueHaibing Committed by Martin K. Petersen

scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Link: https://lore.kernel.org/r/20190904130457.24744-1-yuehaibing@huawei.comReported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Acked-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0b275551
......@@ -447,13 +447,11 @@ static int ufs_hisi_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
static int ufs_hisi_get_resource(struct ufs_hisi_host *host)
{
struct resource *mem_res;
struct device *dev = host->hba->dev;
struct platform_device *pdev = to_platform_device(dev);
/* get resource of ufs sys ctrl */
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
host->ufs_sys_ctrl = devm_ioremap_resource(dev, mem_res);
host->ufs_sys_ctrl = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(host->ufs_sys_ctrl))
return PTR_ERR(host->ufs_sys_ctrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment