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: <20bf47ec857e02a61477dd9eefc19a7a1bc963ed.camel@mediatek.com>
Date: Wed, 21 Aug 2024 08:01:00 +0000
From: Yong Wu (吴勇) <Yong.Wu@...iatek.com>
To: "linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"krzk@...nel.org" <krzk@...nel.org>, "honghui.zhang@...iatek.com"
	<honghui.zhang@...iatek.com>, "jroedel@...e.de" <jroedel@...e.de>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "rongqianfeng@...o.com"
	<rongqianfeng@...o.com>, "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
	"angelogioacchino.delregno@...labora.com"
	<angelogioacchino.delregno@...labora.com>
CC: "opensource.kernel@...o.com" <opensource.kernel@...o.com>
Subject: Re: [PATCH v2] memory: mtk-smi: Use devm_clk_get_enabled()

On Wed, 2024-08-21 at 11:25 +0800, Rong Qianfeng wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  Replace devm_clk_get() and clk_prepare_enable() with
> 
> devm_clk_get_enabled() in .probe().
> 
> 
> 
> Fix the bug of missing clk_disable_unprepare() in .remove() by 
> 
> using devm_clk_get_enabled() that can disables and unprepares 
> 
> it automatically on driver detach.
> 
> 
> Fixes: 3c8f4ad85c4b ("memory/mediatek: add support for mt2701")
> 
> Cc: honghui.zhang@...iatek.com
> 
> Signed-off-by: Rong Qianfeng <rongqianfeng@...o.com>

Reviewed-by: Yong Wu <yong.wu@...iatek.com>

> ---
> 
> Version 2 changes:
> 
> 1. Modified the patch description as suggested by Krzysztof.
> 
> 
>  drivers/memory/mtk-smi.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index fbe52ecc0eca..2bc034dff691 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -771,13 +771,9 @@ static int mtk_smi_common_probe(struct
> platform_device *pdev)
>  		if (IS_ERR(common->smi_ao_base))
>  			return PTR_ERR(common->smi_ao_base);
>  
> -		common->clk_async = devm_clk_get(dev, "async");
> +		common->clk_async = devm_clk_get_enabled(dev, "async");
>  		if (IS_ERR(common->clk_async))
>  			return PTR_ERR(common->clk_async);
> -
> -		ret = clk_prepare_enable(common->clk_async);
> -		if (ret)
> -			return ret;
>  	} else {
>  		common->base = devm_platform_ioremap_resource(pdev, 0);
>  		if (IS_ERR(common->base))
> -- 
> 2.39.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ