lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130205092554.GR32118@arwen.pp.htv.fi>
Date:	Tue, 5 Feb 2013 11:25:54 +0200
From:	Felipe Balbi <balbi@...com>
To:	Roger Quadros <rogerq@...com>
CC:	<tony@...mide.com>, <linux@....linux.org.uk>,
	<sameo@...ux.intel.com>, <balbi@...com>,
	<stern@...land.harvard.edu>, <gregkh@...uxfoundation.org>,
	<eballetbo@...il.com>, <javier@...hile0.org>,
	<sshtylyov@...sta.com>, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

On Mon, Jan 28, 2013 at 01:30:10PM +0200, Roger Quadros wrote:
> Make use of devm_request_and_ioremap() and correct comment.
> 
> Signed-off-by: Roger Quadros <rogerq@...com>

Acked-by: Felipe Balbi <balbi@...com>

> ---
>  drivers/usb/host/ehci-omap.c |   19 +++++--------------
>  1 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 30fc482..fd2f5450 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -216,23 +216,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  
>  	res =  platform_get_resource_byname(pdev,
>  				IORESOURCE_MEM, "ehci");
> -	if (!res) {
> -		dev_err(dev, "UHH EHCI get resource failed\n");
> -		return -ENODEV;
> -	}
> -
> -	regs = ioremap(res->start, resource_size(res));
> +	regs = devm_request_and_ioremap(dev, res);
>  	if (!regs) {
> -		dev_err(dev, "UHH EHCI ioremap failed\n");
> -		return -ENOMEM;
> +		dev_err(dev, "Resource request/ioremap failed\n");
> +		return -EADDRNOTAVAIL;
>  	}
>  
>  	hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
>  			dev_name(dev));
>  	if (!hcd) {
> -		dev_err(dev, "failed to create hcd with err %d\n", ret);
> -		ret = -ENOMEM;
> -		goto err_io;
> +		dev_err(dev, "Failed to create HCD\n");
> +		return -ENOMEM;
>  	}
>  
>  	hcd->rsrc_start = res->start;
> @@ -285,8 +279,6 @@ err_pm_runtime:
>  	pm_runtime_put_sync(dev);
>  	usb_put_hcd(hcd);
>  
> -err_io:
> -	iounmap(regs);
>  	return ret;
>  }
>  
> @@ -306,7 +298,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
>  
>  	usb_remove_hcd(hcd);
>  	disable_put_regulator(dev->platform_data);
> -	iounmap(hcd->regs);
>  	usb_put_hcd(hcd);
>  
>  	pm_runtime_put_sync(dev);
> -- 
> 1.7.4.1
> 

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ