mtd: rawnand: ingenic: remove redundant get_device() in ingenic_ecc_get()
diff mbox series

Message ID 20201031105439.2304211-1-yukuai3@huawei.com
State In Next
Commit 9f14bf29d6ba0d18dc5175bbf22a07ec3dc67f23
Headers show
Series
  • mtd: rawnand: ingenic: remove redundant get_device() in ingenic_ecc_get()
Related show

Commit Message

Yu Kuai Oct. 31, 2020, 10:54 a.m. UTC
of_find_device_by_node() already takes a reference to the device, and
ingenic_ecc_release() will drop the reference. So, the get_device() in
ingenic_ecc_get() is redundand.

Fixes: 15de8c6efd0e("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Yu Kuai Nov. 9, 2020, 1:12 p.m. UTC | #1
ping..

On 2020/10/31 18:54, Yu Kuai wrote:
> of_find_device_by_node() already takes a reference to the device, and
> ingenic_ecc_release() will drop the reference. So, the get_device() in
> ingenic_ecc_get() is redundand.
> 
> Fixes: 15de8c6efd0e("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>   drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> index 8e22cd6ec71f..efe0ffe4f1ab 100644
> --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> @@ -71,8 +71,6 @@ static struct ingenic_ecc *ingenic_ecc_get(struct device_node *np)
>   	if (!pdev || !platform_get_drvdata(pdev))
>   		return ERR_PTR(-EPROBE_DEFER);
>   
> -	get_device(&pdev->dev);
> -
>   	ecc = platform_get_drvdata(pdev);
>   	clk_prepare_enable(ecc->clk);
>   
>
Paul Cercueil Nov. 10, 2020, 8:38 a.m. UTC | #2
Hi,

Le sam. 31 oct. 2020 à 18:54, Yu Kuai <yukuai3@huawei.com> a écrit :
> of_find_device_by_node() already takes a reference to the device, and
> ingenic_ecc_release() will drop the reference. So, the get_device() in
> ingenic_ecc_get() is redundand.
> 
> Fixes: 15de8c6efd0e("mtd: rawnand: ingenic: Separate top-level and 
> SoC specific code")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Acked-by: Paul Cercueil <paul@crapouillou.net>

Thanks,
-Paul

> ---
>  drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c 
> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> index 8e22cd6ec71f..efe0ffe4f1ab 100644
> --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> @@ -71,8 +71,6 @@ static struct ingenic_ecc *ingenic_ecc_get(struct 
> device_node *np)
>  	if (!pdev || !platform_get_drvdata(pdev))
>  		return ERR_PTR(-EPROBE_DEFER);
> 
> -	get_device(&pdev->dev);
> -
>  	ecc = platform_get_drvdata(pdev);
>  	clk_prepare_enable(ecc->clk);
> 
> --
> 2.25.4
>
Miquel Raynal Nov. 19, 2020, 9:11 p.m. UTC | #3
On Sat, 2020-10-31 at 10:54:39 UTC, Yu Kuai wrote:
> of_find_device_by_node() already takes a reference to the device, and
> ingenic_ecc_release() will drop the reference. So, the get_device() in
> ingenic_ecc_get() is redundand.
> 
> Fixes: 15de8c6efd0e("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> Acked-by: Paul Cercueil <paul@crapouillou.net>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

Patch
diff mbox series

diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
index 8e22cd6ec71f..efe0ffe4f1ab 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
@@ -71,8 +71,6 @@  static struct ingenic_ecc *ingenic_ecc_get(struct device_node *np)
 	if (!pdev || !platform_get_drvdata(pdev))
 		return ERR_PTR(-EPROBE_DEFER);
 
-	get_device(&pdev->dev);
-
 	ecc = platform_get_drvdata(pdev);
 	clk_prepare_enable(ecc->clk);