Re: [PATCH] usb: renesas_usbhs: convert to devm_xxx()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 10, 2012 at 02:11:32AM -0700, Kuninori Morimoto wrote:
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
> ---
>  drivers/usb/renesas_usbhs/common.c |   16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index 681da06..d56e1f6 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -432,17 +432,17 @@ static int usbhs_probe(struct platform_device *pdev)
>  	}
>  
>  	/* usb private data */
> -	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> +	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv) {
>  		dev_err(&pdev->dev, "Could not allocate priv\n");
>  		return -ENOMEM;
>  	}
>  
> -	priv->base = ioremap_nocache(res->start, resource_size(res));
> +	priv->base = devm_ioremap_nocache(&pdev->dev,
> +					  res->start, resource_size(res));

you need to request the address space too, so convert this into
devm_request_and_ioremap().

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux