DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: nvec: make use of devm_platform_ioremap_resource
@ 2019-09-08  9:41 hariprasad, Kelam, hariprasad.kelam
  2019-09-09 18:14 ` Marc Dietrich
  0 siblings, 1 reply; 2+ messages in thread
From: hariprasad, Kelam, hariprasad.kelam @ 2019-09-08  9:41 UTC (permalink / raw)
  Cc: devel, Hariprasad Kelam, Greg Kroah-Hartman, linux-kernel,
	linux-tegra, ac100

From: Hariprasad Kelam <hariprasad.kelam@gmail.com>

fix below issue reported by coccicheck
drivers/staging//nvec/nvec.c:794:1-5: WARNING: Use
devm_platform_ioremap_resource for base

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/staging/nvec/nvec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 1cbd7b7..360ec04 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -767,7 +767,6 @@ static int tegra_nvec_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct nvec_chip *nvec;
 	struct nvec_msg *msg;
-	struct resource *res;
 	void __iomem *base;
 	char	get_firmware_version[] = { NVEC_CNTL, GET_FIRMWARE_VERSION },
 		unmute_speakers[] = { NVEC_OEM0, 0x10, 0x59, 0x95 },
@@ -790,8 +789,7 @@ static int tegra_nvec_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: nvec: make use of devm_platform_ioremap_resource
  2019-09-08  9:41 [PATCH] staging: nvec: make use of devm_platform_ioremap_resource hariprasad, Kelam, hariprasad.kelam
@ 2019-09-09 18:14 ` Marc Dietrich
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Dietrich @ 2019-09-09 18:14 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: linux-tegra, Greg Kroah-Hartman, devel, linux-kernel, ac100

Hi Hariprased,

On Sun, 8 Sep 2019, hariprasad@MISSING_DOMAIN wrote:
                              ^^^^^^^^^^^^^^^^^^
something is wrong with your git mail config...

> From: Hariprasad Kelam <hariprasad.kelam@gmail.com>
>
> fix below issue reported by coccicheck
> drivers/staging//nvec/nvec.c:794:1-5: WARNING: Use
> devm_platform_ioremap_resource for base
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>

Acked-by: Marc Dietrich <marvin24@gmx.de>

Thanks!

Marc

> ---
> drivers/staging/nvec/nvec.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index 1cbd7b7..360ec04 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -767,7 +767,6 @@ static int tegra_nvec_probe(struct platform_device *pdev)
> 	struct device *dev = &pdev->dev;
> 	struct nvec_chip *nvec;
> 	struct nvec_msg *msg;
> -	struct resource *res;
> 	void __iomem *base;
> 	char	get_firmware_version[] = { NVEC_CNTL, GET_FIRMWARE_VERSION },
> 		unmute_speakers[] = { NVEC_OEM0, 0x10, 0x59, 0x95 },
> @@ -790,8 +789,7 @@ static int tegra_nvec_probe(struct platform_device *pdev)
> 		return -ENODEV;
> 	}
>
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	base = devm_ioremap_resource(dev, res);
> +	base = devm_platform_ioremap_resource(pdev, 0);
> 	if (IS_ERR(base))
> 		return PTR_ERR(base);
>
> -- 
> 2.7.4
>
>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-08  9:41 [PATCH] staging: nvec: make use of devm_platform_ioremap_resource hariprasad, Kelam, hariprasad.kelam
2019-09-09 18:14 ` Marc Dietrich

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org driverdev-devel@archiver.kernel.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox