Commit 2dd39fad authored by Bean Huo's avatar Bean Huo Committed by Martin K. Petersen

scsi: ufs: ufs-exynos: Use devm_platform_ioremap_resource_byname()

Use devm_platform_ioremap_resource_byname() to simplify the code.

Link: https://lore.kernel.org/r/20200916084017.14086-1-huobean@gmail.comAcked-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c1a3bf99
......@@ -940,7 +940,6 @@ static int exynos_ufs_init(struct ufs_hba *hba)
struct device *dev = hba->dev;
struct platform_device *pdev = to_platform_device(dev);
struct exynos_ufs *ufs;
struct resource *res;
int ret;
ufs = devm_kzalloc(dev, sizeof(*ufs), GFP_KERNEL);
......@@ -948,24 +947,21 @@ static int exynos_ufs_init(struct ufs_hba *hba)
return -ENOMEM;
/* exynos-specific hci */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vs_hci");
ufs->reg_hci = devm_ioremap_resource(dev, res);
ufs->reg_hci = devm_platform_ioremap_resource_byname(pdev, "vs_hci");
if (IS_ERR(ufs->reg_hci)) {
dev_err(dev, "cannot ioremap for hci vendor register\n");
return PTR_ERR(ufs->reg_hci);
}
/* unipro */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "unipro");
ufs->reg_unipro = devm_ioremap_resource(dev, res);
ufs->reg_unipro = devm_platform_ioremap_resource_byname(pdev, "unipro");
if (IS_ERR(ufs->reg_unipro)) {
dev_err(dev, "cannot ioremap for unipro register\n");
return PTR_ERR(ufs->reg_unipro);
}
/* ufs protector */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ufsp");
ufs->reg_ufsp = devm_ioremap_resource(dev, res);
ufs->reg_ufsp = devm_platform_ioremap_resource_byname(pdev, "ufsp");
if (IS_ERR(ufs->reg_ufsp)) {
dev_err(dev, "cannot ioremap for ufs protector register\n");
return PTR_ERR(ufs->reg_ufsp);
......
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