[PATCH] DRM: Armada: Use devm_ioremap_resource()

Thierry Reding thierry.reding at gmail.com
Mon Apr 7 03:53:18 PDT 2014


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.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140407/ae3b2dc3/attachment.sig>


More information about the dri-devel mailing list