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:	Wed, 24 Jul 2013 15:38:22 +0300
From:	Felipe Balbi <balbi@...com>
To:	"Ivan T. Ivanov" <iivanov@...sol.com>
CC:	<balbi@...com>, <gregkh@...uxfoundation.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH v2 2/7] usb: phy: msm: Migrate to Managed Device Resource
 allocation

Hi,

On Tue, Jul 09, 2013 at 06:47:08PM +0300, Ivan T. Ivanov wrote:
> From: "Ivan T. Ivanov" <iivanov@...sol.com>
> 
> Use managed device resources to clean up the probe/remove
> and get DT support for free.
> 
> Signed-off-by: Ivan T. Ivanov <iivanov@...sol.com>
> ---
>  drivers/usb/phy/phy-msm-usb.c |   78 +++++++++++------------------------------
>  1 file changed, 20 insertions(+), 58 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index ab1b880..cc37f5e 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -1458,30 +1455,27 @@ static int __init msm_otg_probe(struct platform_device *pdev)
>  	 * clock is introduced to remove the dependency on AXI
>  	 * bus frequency.
>  	 */
> -	motg->core_clk = clk_get(&pdev->dev, "usb_hs_core_clk");
> +	motg->core_clk = devm_clk_get(&pdev->dev, "usb_hs_core_clk");
>  	if (IS_ERR(motg->core_clk))
>  		motg->core_clk = NULL;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {

no need to check for the resource when using devm_ioremap_resource()

>  		dev_err(&pdev->dev, "failed to get platform resource mem\n");
> -		ret = -ENODEV;
> -		goto put_core_clk;
> +		return -ENODEV;
>  	}
>  
> -	motg->regs = ioremap(res->start, resource_size(res));
> +	motg->regs = devm_ioremap_resource(&pdev->dev, res);
>  	if (!motg->regs) {
>  		dev_err(&pdev->dev, "ioremap failed\n");

don't print error messages when using devm_ioremap_resource()

-- 
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