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]
Date:	Fri, 20 Jun 2014 11:57:42 -0500
From:	Felipe Balbi <balbi@...com>
To:	Himangi Saraogi <himangi774@...il.com>
CC:	Mathias Nyman <mathias.nyman@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<julia.lawall@...6.fr>
Subject: Re: [PATCH] usb: host: xhci-plat: use devm_functions

Hi,

On Fri, Jun 20, 2014 at 10:18:53PM +0530, Himangi Saraogi wrote:
> This patch introduces the use of managed interface devm_ioremap_resource
> for ioremap_nocache and request_mem_region and removes the corresponding
> free functions in the probe and remove functions.
> 
> Signed-off-by: Himangi Saraogi <himangi774@...il.com>
> ---
>  drivers/usb/host/xhci-plat.c | 25 +++++--------------------
>  1 file changed, 5 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 29d8adb..31d14a5 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -140,18 +140,11 @@ static int xhci_plat_probe(struct platform_device *pdev)
>  	hcd->rsrc_start = res->start;
>  	hcd->rsrc_len = resource_size(res);
>  
> -	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
> -				driver->description)) {
> -		dev_dbg(&pdev->dev, "controller already in use\n");
> -		ret = -EBUSY;
> -		goto put_hcd;
> -	}
> -
> -	hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
> -	if (!hcd->regs) {
> +	hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(hcd->regs)) {
>  		dev_dbg(&pdev->dev, "error mapping memory\n");

you can remove this dev_dbg() message now that you're using
devm_ioremap_resource().

-- 
balbi

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ