* [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname()
@ 2020-09-16 8:40 ` Bean Huo
2020-09-29 18:15 ` Alim Akhtar
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Bean Huo @ 2020-09-16 8:40 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>
---
v1-v2: change the patch commit subject
---
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] 6+ messages in thread
* RE: [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname()
2020-09-16 8:40 ` [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname() Bean Huo
@ 2020-09-29 18:15 ` Alim Akhtar
2020-09-30 2:55 ` Martin K. Petersen
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Alim Akhtar @ 2020-09-29 18:15 UTC (permalink / raw)
To: 'Bean Huo',
avri.altman, asutoshd, jejb, martin.petersen, stanley.chu,
beanhuo, bvanassche, tomas.winkler, cang
Cc: linux-scsi, linux-kernel, 'Alim Akhtar'
Hi Bean,
> -----Original Message-----
> From: Bean Huo <huobean@gmail.com>
> Sent: 16 September 2020 14:10
> To: alim.akhtar@samsung.com; avri.altman@wdc.com;
> asutoshd@codeaurora.org; jejb@linux.ibm.com;
> martin.petersen@oracle.com; stanley.chu@mediatek.com;
> beanhuo@micron.com; bvanassche@acm.org; tomas.winkler@intel.com;
> cang@codeaurora.org
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH v2] scsi: ufs-exynos: use
> devm_platform_ioremap_resource_byname()
>
> From: Bean Huo <beanhuo@micron.com>
>
> Use devm_platform_ioremap_resource_byname() to simplify the code.
>
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
Thanks!
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>
>
> v1-v2: change the patch commit subject
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname()
2020-09-16 8:40 ` [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname() Bean Huo
2020-09-29 18:15 ` Alim Akhtar
@ 2020-09-30 2:55 ` Martin K. Petersen
2020-10-03 3:26 ` Martin K. Petersen
2020-11-12 14:06 ` Geert Uytterhoeven
3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-09-30 2:55 UTC (permalink / raw)
To: Bean Huo
Cc: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
stanley.chu, beanhuo, bvanassche, tomas.winkler, cang,
linux-scsi, linux-kernel
Bean,
> Use devm_platform_ioremap_resource_byname() to simplify the code.
Applied to 5.10/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname()
2020-09-16 8:40 ` [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname() Bean Huo
2020-09-29 18:15 ` Alim Akhtar
2020-09-30 2:55 ` Martin K. Petersen
@ 2020-10-03 3:26 ` Martin K. Petersen
2020-11-12 14:06 ` Geert Uytterhoeven
3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-10-03 3:26 UTC (permalink / raw)
To: stanley.chu, cang, tomas.winkler, bvanassche, jejb, asutoshd,
Bean Huo, alim.akhtar, avri.altman, beanhuo
Cc: Martin K . Petersen, linux-scsi, linux-kernel
On Wed, 16 Sep 2020 10:40:17 +0200, Bean Huo wrote:
> Use devm_platform_ioremap_resource_byname() to simplify the code.
Applied to 5.10/scsi-queue, thanks!
[1/1] scsi: ufs: ufs-exynos: Use devm_platform_ioremap_resource_byname()
https://git.kernel.org/mkp/scsi/c/2dd39fad92a1
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname()
2020-09-16 8:40 ` [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname() Bean Huo
` (2 preceding siblings ...)
2020-10-03 3:26 ` Martin K. Petersen
@ 2020-11-12 14:06 ` Geert Uytterhoeven
2020-11-12 14:10 ` Geert Uytterhoeven
3 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2020-11-12 14:06 UTC (permalink / raw)
To: Bean Huo
Cc: alim.akhtar, avri.altman, asutoshd, James E.J. Bottomley,
Martin K. Petersen, stanley.chu,
Bean Huo 霍斌斌 (beanhuo),
Bart Van Assche, Winkler, Tomas, cang, scsi,
Linux Kernel Mailing List
Hi Bean,
On Wed, Sep 16, 2020 at 10:43 AM Bean Huo <huobean@gmail.com> wrote:
> From: Bean Huo <beanhuo@micron.com>
>
> Use devm_platform_ioremap_resource_byname() to simplify the code.
>
> Signed-off-by: Bean Huo <beanhuo@micron.com>
Thanks for your patch, which is now commit 2dd39fad92a1f25f ("scsi: ufs:
ufs-exynos: Use devm_platform_ioremap_resource_byname()") in v5.10-rc1.
> --- 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");
Are you sure this is equivalent?
Before, devm_ioremap_resource() was called on "dev" (hba->dev),
after it is called on "&pdev->dev" .
> 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);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname()
2020-11-12 14:06 ` Geert Uytterhoeven
@ 2020-11-12 14:10 ` Geert Uytterhoeven
0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2020-11-12 14:10 UTC (permalink / raw)
To: Bean Huo
Cc: alim.akhtar, avri.altman, asutoshd, James E.J. Bottomley,
Martin K. Petersen, stanley.chu,
Bean Huo 霍斌斌 (beanhuo),
Bart Van Assche, Winkler, Tomas, cang, scsi,
Linux Kernel Mailing List
Hi Bean,
On Thu, Nov 12, 2020 at 3:06 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Wed, Sep 16, 2020 at 10:43 AM Bean Huo <huobean@gmail.com> wrote:
> > From: Bean Huo <beanhuo@micron.com>
> >
> > Use devm_platform_ioremap_resource_byname() to simplify the code.
> >
> > Signed-off-by: Bean Huo <beanhuo@micron.com>
>
> Thanks for your patch, which is now commit 2dd39fad92a1f25f ("scsi: ufs:
> ufs-exynos: Use devm_platform_ioremap_resource_byname()") in v5.10-rc1.
>
> > --- 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");
>
> Are you sure this is equivalent?
> Before, devm_ioremap_resource() was called on "dev" (hba->dev),
> after it is called on "&pdev->dev" .
Yes it is, due to:
struct platform_device *pdev = to_platform_device(dev);
Sorry for the noise.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-11-12 14:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20200916084036epcas5p3420a185827331c7dd4494f2adb115ead@epcas5p3.samsung.com>
2020-09-16 8:40 ` [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname() Bean Huo
2020-09-29 18:15 ` Alim Akhtar
2020-09-30 2:55 ` Martin K. Petersen
2020-10-03 3:26 ` Martin K. Petersen
2020-11-12 14:06 ` Geert Uytterhoeven
2020-11-12 14:10 ` Geert Uytterhoeven
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).