* [PATCH 0/2] Use devm_platform_ioremap_resource_byname()
@ 2020-09-15 18:07 Bean Huo
2020-09-15 18:07 ` [PATCH 1/2] scsi: ufs-mediatek: use devm_platform_ioremap_resource_byname() Bean Huo
2020-09-15 18:07 ` [PATCH 2/2] scsi: ufs-qcom: " Bean Huo
0 siblings, 2 replies; 4+ messages in thread
From: Bean Huo @ 2020-09-15 18:07 UTC (permalink / raw)
To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
stanley.chu, beanhuo, bvanassche, tomas.winkler, cang
Cc: linux-scsi, linux-kernel
From: Bean Huo <beanhuo@micron.com>
platform_get_resource_byname() and devm_ioremap_resource() have been wrapped
to the single helper devm_platform_ioremap_resource_byname(), so use it and
simplify the code.
Bean Huo (2):
scsi: ufs-mediatek: use devm_platform_ioremap_resource_byname()
scsi: ufs-qcom: use devm_platform_ioremap_resource_byname()
drivers/scsi/ufs/ufs-exynos.c | 10 +++-------
drivers/scsi/ufs/ufs-qcom-ice.c | 9 +--------
drivers/scsi/ufs/ufs-qcom.c | 23 +++++++++--------------
3 files changed, 13 insertions(+), 29 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] scsi: ufs-mediatek: use devm_platform_ioremap_resource_byname()
2020-09-15 18:07 [PATCH 0/2] Use devm_platform_ioremap_resource_byname() Bean Huo
@ 2020-09-15 18:07 ` Bean Huo
[not found] ` <CAOBeenZX-E5ZxUtR9iDDjTxMUBKtsU529TaPz4x=u2UWWfB1pg@mail.gmail.com>
2020-09-15 18:07 ` [PATCH 2/2] scsi: ufs-qcom: " Bean Huo
1 sibling, 1 reply; 4+ messages in thread
From: Bean Huo @ 2020-09-15 18:07 UTC (permalink / raw)
To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
stanley.chu, beanhuo, bvanassche, tomas.winkler, cang
Cc: linux-scsi, linux-kernel
From: Bean Huo <beanhuo@micron.com>
Use devm_platform_ioremap_resource_byname() to simplify the code.
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
drivers/scsi/ufs/ufs-exynos.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 8f1b6f61a776..1eecbe550536 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] scsi: ufs-qcom: use devm_platform_ioremap_resource_byname()
2020-09-15 18:07 [PATCH 0/2] Use devm_platform_ioremap_resource_byname() Bean Huo
2020-09-15 18:07 ` [PATCH 1/2] scsi: ufs-mediatek: use devm_platform_ioremap_resource_byname() Bean Huo
@ 2020-09-15 18:07 ` Bean Huo
1 sibling, 0 replies; 4+ messages in thread
From: Bean Huo @ 2020-09-15 18:07 UTC (permalink / raw)
To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
stanley.chu, beanhuo, bvanassche, tomas.winkler, cang
Cc: linux-scsi, linux-kernel
From: Bean Huo <beanhuo@micron.com>
Use devm_platform_ioremap_resource_byname() to simplify the code.
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
drivers/scsi/ufs/ufs-qcom-ice.c | 9 +--------
drivers/scsi/ufs/ufs-qcom.c | 23 +++++++++--------------
2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/drivers/scsi/ufs/ufs-qcom-ice.c b/drivers/scsi/ufs/ufs-qcom-ice.c
index bbb0ad7590ec..cd67869a725e 100644
--- a/drivers/scsi/ufs/ufs-qcom-ice.c
+++ b/drivers/scsi/ufs/ufs-qcom-ice.c
@@ -97,25 +97,18 @@ int ufs_qcom_ice_init(struct ufs_qcom_host *host)
struct ufs_hba *hba = host->hba;
struct device *dev = hba->dev;
struct platform_device *pdev = to_platform_device(dev);
- struct resource *res;
int err;
if (!(ufshcd_readl(hba, REG_CONTROLLER_CAPABILITIES) &
MASK_CRYPTO_SUPPORT))
return 0;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ice");
- if (!res) {
- dev_warn(dev, "ICE registers not found\n");
- goto disable;
- }
-
if (!qcom_scm_ice_available()) {
dev_warn(dev, "ICE SCM interface not found\n");
goto disable;
}
- host->ice_mmio = devm_ioremap_resource(dev, res);
+ host->ice_mmio = devm_platform_ioremap_resource_byname(pdev, "ice");
if (IS_ERR(host->ice_mmio)) {
err = PTR_ERR(host->ice_mmio);
dev_err(dev, "Failed to map ICE registers; err=%d\n", err);
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index f9d6ef356540..c0c76da5472a 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -976,7 +976,6 @@ static int ufs_qcom_init(struct ufs_hba *hba)
struct device *dev = hba->dev;
struct platform_device *pdev = to_platform_device(dev);
struct ufs_qcom_host *host;
- struct resource *res;
if (strlen(android_boot_dev) && strcmp(android_boot_dev, dev_name(dev)))
return -ENODEV;
@@ -1059,20 +1058,16 @@ static int ufs_qcom_init(struct ufs_hba *hba)
host->dev_ref_clk_en_mask = BIT(26);
} else {
/* "dev_ref_clk_ctrl_mem" is optional resource */
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
- "dev_ref_clk_ctrl_mem");
- if (res) {
- host->dev_ref_clk_ctrl_mmio =
- devm_ioremap_resource(dev, res);
- if (IS_ERR(host->dev_ref_clk_ctrl_mmio)) {
- dev_warn(dev,
- "%s: could not map dev_ref_clk_ctrl_mmio, err %ld\n",
- __func__,
- PTR_ERR(host->dev_ref_clk_ctrl_mmio));
- host->dev_ref_clk_ctrl_mmio = NULL;
- }
- host->dev_ref_clk_en_mask = BIT(5);
+ host->dev_ref_clk_ctrl_mmio =
+ devm_platform_ioremap_resource_byname(pdev,
+ "dev_ref_clk_ctrl_mem");
+ if (IS_ERR(host->dev_ref_clk_ctrl_mmio)) {
+ dev_warn(dev,
+ "%s: could not map dev_ref_clk_ctrl_mmio, err %ld\n",
+ __func__, PTR_ERR(host->dev_ref_clk_ctrl_mmio));
+ host->dev_ref_clk_ctrl_mmio = NULL;
}
+ host->dev_ref_clk_en_mask = BIT(5);
}
err = ufs_qcom_init_lane_clks(host);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] scsi: ufs-mediatek: use devm_platform_ioremap_resource_byname()
[not found] ` <CAOBeenZX-E5ZxUtR9iDDjTxMUBKtsU529TaPz4x=u2UWWfB1pg@mail.gmail.com>
@ 2020-09-16 9:11 ` Bean Huo
0 siblings, 0 replies; 4+ messages in thread
From: Bean Huo @ 2020-09-16 9:11 UTC (permalink / raw)
To: Stanley Chu
Cc: alim.akhtar, asutoshd, avri.altman, beanhuo, bvanassche, cang,
jejb, linux-kernel, linux-scsi, martin.petersen, stanley.chu,
tomas.winkler
On Wed, 2020-09-16 at 08:06 +0800, Stanley Chu wrote:
> Hi Bean,
>
> Maybe the title should be “ufs-exynos”?
Hi Stanley
Thanks, I have pushed a new version for this patch and the subject of
the patch has been changed.
Thanks,
Bean
>
> Thanks,
> Stanley Chu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-16 9:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 18:07 [PATCH 0/2] Use devm_platform_ioremap_resource_byname() Bean Huo
2020-09-15 18:07 ` [PATCH 1/2] scsi: ufs-mediatek: use devm_platform_ioremap_resource_byname() Bean Huo
[not found] ` <CAOBeenZX-E5ZxUtR9iDDjTxMUBKtsU529TaPz4x=u2UWWfB1pg@mail.gmail.com>
2020-09-16 9:11 ` Bean Huo
2020-09-15 18:07 ` [PATCH 2/2] scsi: ufs-qcom: " Bean Huo
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).