[PATCH] DRM: Armada: Use devm_ioremap_resource()

Jingoo Han jg1.han at samsung.com
Mon Apr 7 21:38:27 PDT 2014


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 at 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



More information about the dri-devel mailing list