diff mbox

DRM: Armada: Use devm_ioremap_resource()

Message ID 001e01cf4ed3$ff410170$fdc30450$%han@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jingoo Han April 3, 2014, 12:31 a.m. UTC
Use devm_ioremap_resource() because devm_request_and_ioremap() is
obsoleted by devm_ioremap_resource().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/gpu/drm/armada/armada_crtc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Thierry Reding April 7, 2014, 10:53 a.m. UTC | #1
On Thu, Apr 03, 2014 at 09:31:04AM +0900, Jingoo Han wrote:
> Use devm_ioremap_resource() because devm_request_and_ioremap() is
> obsoleted by devm_ioremap_resource().
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/gpu/drm/armada/armada_crtc.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
> index d8e3982..23b0123 100644
> --- a/drivers/gpu/drm/armada/armada_crtc.c
> +++ b/drivers/gpu/drm/armada/armada_crtc.c
> @@ -1037,10 +1037,10 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
>  	if (ret)
>  		return ret;
>  
> -	base = devm_request_and_ioremap(dev->dev, res);
> -	if (!base) {
> +	base = devm_ioremap_resource(dev->dev, res);
> +	if (IS_ERR(base)) {
>  		DRM_ERROR("failed to ioremap register\n");
> -		return -ENOMEM;
> +		return PTR_ERR(base);

While at it, perhaps you should drop the error message too because
devm_ioremap_resource() already prints one in all failure cases.

Thierry
Jingoo Han April 8, 2014, 4:38 a.m. UTC | #2
On Monday, April 07, 2014 7:53 PM, Thierry Reding wrote:
> On Thu, Apr 03, 2014 at 09:31:04AM +0900, Jingoo Han wrote:
> > Use devm_ioremap_resource() because devm_request_and_ioremap() is
> > obsoleted by devm_ioremap_resource().
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> >  drivers/gpu/drm/armada/armada_crtc.c |    6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
> > index d8e3982..23b0123 100644
> > --- a/drivers/gpu/drm/armada/armada_crtc.c
> > +++ b/drivers/gpu/drm/armada/armada_crtc.c
> > @@ -1037,10 +1037,10 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
> >  	if (ret)
> >  		return ret;
> >
> > -	base = devm_request_and_ioremap(dev->dev, res);
> > -	if (!base) {
> > +	base = devm_ioremap_resource(dev->dev, res);
> > +	if (IS_ERR(base)) {
> >  		DRM_ERROR("failed to ioremap register\n");
> > -		return -ENOMEM;
> > +		return PTR_ERR(base);
> 
> While at it, perhaps you should drop the error message too because
> devm_ioremap_resource() already prints one in all failure cases.

Oh, right! It is my mistake. I will remove the error message.
Thank you for your comment.

Best regards,
Jingoo Han
diff mbox

Patch

diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index d8e3982..23b0123 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1037,10 +1037,10 @@  int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
 	if (ret)
 		return ret;
 
-	base = devm_request_and_ioremap(dev->dev, res);
-	if (!base) {
+	base = devm_ioremap_resource(dev->dev, res);
+	if (IS_ERR(base)) {
 		DRM_ERROR("failed to ioremap register\n");
-		return -ENOMEM;
+		return PTR_ERR(base);
 	}
 
 	dcrtc = kzalloc(sizeof(*dcrtc), GFP_KERNEL);