linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource
       [not found] <1368173847-5661-1-git-send-email-wsa@the-dreams.de>
@ 2013-05-10  8:17 ` Wolfram Sang
  2013-05-11  5:33   ` Jingoo Han
  2013-05-10  8:17 ` [RFC 33/42] drivers/video/omap2: " Wolfram Sang
  2013-05-10  8:17 ` [RFC 34/42] drivers/video/omap2/dss: " Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2013-05-10  8:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wolfram Sang, Florian Tobias Schandinat, linux-fbdev

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/video/mxsfb.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 1b2c26d..3dc3265 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -883,12 +883,6 @@ static int mxsfb_probe(struct platform_device *pdev)
 	if (of_id)
 		pdev->id_entry = of_id->data;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "Cannot get memory IO resource\n");
-		return -ENODEV;
-	}
-
 	fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
 	if (!fb_info) {
 		dev_err(&pdev->dev, "Failed to allocate fbdev\n");
@@ -897,6 +891,7 @@ static int mxsfb_probe(struct platform_device *pdev)
 
 	host = to_imxfb_host(fb_info);
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	host->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(host->base)) {
 		dev_err(&pdev->dev, "ioremap failed\n");
-- 
1.7.10.4


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

* [RFC 33/42] drivers/video/omap2: don't check resource with devm_ioremap_resource
       [not found] <1368173847-5661-1-git-send-email-wsa@the-dreams.de>
  2013-05-10  8:17 ` [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource Wolfram Sang
@ 2013-05-10  8:17 ` Wolfram Sang
  2013-05-11  5:37   ` Jingoo Han
  2013-05-10  8:17 ` [RFC 34/42] drivers/video/omap2/dss: " Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2013-05-10  8:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wolfram Sang, Tomi Valkeinen, Florian Tobias Schandinat,
	linux-omap, linux-fbdev

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/video/omap2/vrfb.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c
index 5261229..f346b02 100644
--- a/drivers/video/omap2/vrfb.c
+++ b/drivers/video/omap2/vrfb.c
@@ -353,11 +353,6 @@ static int __init vrfb_probe(struct platform_device *pdev)
 	/* first resource is the register res, the rest are vrfb contexts */
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem) {
-		dev_err(&pdev->dev, "can't get vrfb base address\n");
-		return -EINVAL;
-	}
-
 	vrfb_base = devm_ioremap_resource(&pdev->dev, mem);
 	if (IS_ERR(vrfb_base))
 		return PTR_ERR(vrfb_base);
-- 
1.7.10.4


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

* [RFC 34/42] drivers/video/omap2/dss: don't check resource with devm_ioremap_resource
       [not found] <1368173847-5661-1-git-send-email-wsa@the-dreams.de>
  2013-05-10  8:17 ` [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource Wolfram Sang
  2013-05-10  8:17 ` [RFC 33/42] drivers/video/omap2: " Wolfram Sang
@ 2013-05-10  8:17 ` Wolfram Sang
  2013-05-11  5:36   ` Jingoo Han
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2013-05-10  8:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wolfram Sang, Tomi Valkeinen, Florian Tobias Schandinat,
	linux-omap, linux-fbdev

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/video/omap2/dss/hdmi.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 17f4d55..7bc6762 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1064,13 +1064,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 	mutex_init(&hdmi.lock);
 	mutex_init(&hdmi.ip_data.lock);
 
-	res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		DSSERR("can't get IORESOURCE_MEM HDMI\n");
-		return -EINVAL;
-	}
-
 	/* Base address taken from platform */
+	res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
 	hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(hdmi.ip_data.base_wp))
 		return PTR_ERR(hdmi.ip_data.base_wp);
-- 
1.7.10.4


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

* Re: [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource
  2013-05-10  8:17 ` [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource Wolfram Sang
@ 2013-05-11  5:33   ` Jingoo Han
  2013-05-13  5:39     ` Shawn Guo
  0 siblings, 1 reply; 7+ messages in thread
From: Jingoo Han @ 2013-05-11  5:33 UTC (permalink / raw)
  To: 'Wolfram Sang', linux-kernel
  Cc: 'Florian Tobias Schandinat', linux-fbdev,
	'Tomi Valkeinen', 'Shawn Guo', Fabio Estevam

On Friday, May 10, 2013 5:17 PM, Wolfram Sang wrote:
> 
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

CC'ed Tomi Valkeinen, Shawn Guo, Fabio Estevam


It looks good.
Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/mxsfb.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
> index 1b2c26d..3dc3265 100644
> --- a/drivers/video/mxsfb.c
> +++ b/drivers/video/mxsfb.c
> @@ -883,12 +883,6 @@ static int mxsfb_probe(struct platform_device *pdev)
>  	if (of_id)
>  		pdev->id_entry = of_id->data;
> 
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "Cannot get memory IO resource\n");
> -		return -ENODEV;
> -	}
> -
>  	fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
>  	if (!fb_info) {
>  		dev_err(&pdev->dev, "Failed to allocate fbdev\n");
> @@ -897,6 +891,7 @@ static int mxsfb_probe(struct platform_device *pdev)
> 
>  	host = to_imxfb_host(fb_info);
> 
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	host->base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(host->base)) {
>  		dev_err(&pdev->dev, "ioremap failed\n");
> --
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [RFC 34/42] drivers/video/omap2/dss: don't check resource with devm_ioremap_resource
  2013-05-10  8:17 ` [RFC 34/42] drivers/video/omap2/dss: " Wolfram Sang
@ 2013-05-11  5:36   ` Jingoo Han
  0 siblings, 0 replies; 7+ messages in thread
From: Jingoo Han @ 2013-05-11  5:36 UTC (permalink / raw)
  To: 'Wolfram Sang', linux-kernel
  Cc: 'Tomi Valkeinen', 'Florian Tobias Schandinat',
	linux-omap, linux-fbdev

On Friday, May 10, 2013 5:17 PM, Wolfram Sang wrote:
> 
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

It looks good.
Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/omap2/dss/hdmi.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
> index 17f4d55..7bc6762 100644
> --- a/drivers/video/omap2/dss/hdmi.c
> +++ b/drivers/video/omap2/dss/hdmi.c
> @@ -1064,13 +1064,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
>  	mutex_init(&hdmi.lock);
>  	mutex_init(&hdmi.ip_data.lock);
> 
> -	res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		DSSERR("can't get IORESOURCE_MEM HDMI\n");
> -		return -EINVAL;
> -	}
> -
>  	/* Base address taken from platform */
> +	res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
>  	hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(hdmi.ip_data.base_wp))
>  		return PTR_ERR(hdmi.ip_data.base_wp);
> --
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [RFC 33/42] drivers/video/omap2: don't check resource with devm_ioremap_resource
  2013-05-10  8:17 ` [RFC 33/42] drivers/video/omap2: " Wolfram Sang
@ 2013-05-11  5:37   ` Jingoo Han
  0 siblings, 0 replies; 7+ messages in thread
From: Jingoo Han @ 2013-05-11  5:37 UTC (permalink / raw)
  To: 'Wolfram Sang', linux-kernel
  Cc: 'Tomi Valkeinen', 'Florian Tobias Schandinat',
	linux-omap, linux-fbdev

On Friday, May 10, 2013 5:17 PM, Wolfram Sang wrote:
> 
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/omap2/vrfb.c |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c
> index 5261229..f346b02 100644
> --- a/drivers/video/omap2/vrfb.c
> +++ b/drivers/video/omap2/vrfb.c
> @@ -353,11 +353,6 @@ static int __init vrfb_probe(struct platform_device *pdev)
>  	/* first resource is the register res, the rest are vrfb contexts */
> 
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!mem) {
> -		dev_err(&pdev->dev, "can't get vrfb base address\n");
> -		return -EINVAL;
> -	}
> -
>  	vrfb_base = devm_ioremap_resource(&pdev->dev, mem);
>  	if (IS_ERR(vrfb_base))
>  		return PTR_ERR(vrfb_base);
> --
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource
  2013-05-11  5:33   ` Jingoo Han
@ 2013-05-13  5:39     ` Shawn Guo
  0 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2013-05-13  5:39 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Wolfram Sang', linux-kernel,
	'Florian Tobias Schandinat', linux-fbdev,
	'Tomi Valkeinen', Fabio Estevam

On Sat, May 11, 2013 at 02:33:56PM +0900, Jingoo Han wrote:
> On Friday, May 10, 2013 5:17 PM, Wolfram Sang wrote:
> > 
> > devm_ioremap_resource does sanity checks on the given resource. No need to
> > duplicate this in the driver.
> > 
> > Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> 
> CC'ed Tomi Valkeinen, Shawn Guo, Fabio Estevam

Acked-by: Shawn Guo <shawn.guo@linaro.org>


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

end of thread, other threads:[~2013-05-13  5:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1368173847-5661-1-git-send-email-wsa@the-dreams.de>
2013-05-10  8:17 ` [RFC 32/42] drivers/video: don't check resource with devm_ioremap_resource Wolfram Sang
2013-05-11  5:33   ` Jingoo Han
2013-05-13  5:39     ` Shawn Guo
2013-05-10  8:17 ` [RFC 33/42] drivers/video/omap2: " Wolfram Sang
2013-05-11  5:37   ` Jingoo Han
2013-05-10  8:17 ` [RFC 34/42] drivers/video/omap2/dss: " Wolfram Sang
2013-05-11  5:36   ` Jingoo Han

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).