On 04/16/2015 02:17 PM, weiyj...@163.com wrote:
> From: Wei Yongjun <yongjun_...@trendmicro.com.cn>
> 
> In case of error, the function devm_ioremap_resource() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_...@trendmicro.com.cn>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c 
> b/drivers/usb/gadget/udc/udc-xilinx.c
> index dd3e9fd..cfe0349 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -2071,8 +2071,8 @@ static int xudc_probe(struct platform_device *pdev)
>       /* Map the registers */
>       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>       udc->addr = devm_ioremap_resource(&pdev->dev, res);
> -     if (!udc->addr)
> -             return -ENOMEM;
> +     if (IS_ERR(udc->addr))
> +             return PTR_ERR(udc->addr);
>  
>       irq = platform_get_irq(pdev, 0);
>       if (irq < 0) {
> 

Reviewed-by: Michal Simek <michal.si...@xilinx.com>

Thanks,
Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to