[3/3] PCI: brcmstb: Drop clk_put when probe fails and remove
diff mbox series

Message ID 20200213025930.27943-4-jaedon.shin@gmail.com
State New
Headers show
Series
  • PCI: brcmstb: Add Broadcom STB support
Related show

Commit Message

Jaedon Shin Feb. 13, 2020, 2:59 a.m. UTC
devm_clk_get* APIs are device managed and get freed automatically when
the device detaches. so there is no reason to explicitly call clk_put()
in probe or remove functions.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/pci/controller/pcie-brcmstb.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Florian Fainelli Feb. 13, 2020, 4:01 a.m. UTC | #1
On 2/12/2020 6:59 PM, Jaedon Shin wrote:
> devm_clk_get* APIs are device managed and get freed automatically when
> the device detaches. so there is no reason to explicitly call clk_put()
> in probe or remove functions.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Fixes: c0452137034b ("PCI: brcmstb: Add Broadcom STB PCIe host
controller driver")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>


> ---
>  drivers/pci/controller/pcie-brcmstb.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index 0e0ca39a680b..3e48d9e238bb 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -972,7 +972,6 @@ static void __brcm_pcie_remove(struct brcm_pcie *pcie)
>  	brcm_pcie_turn_off(pcie);
>  	brcm_pcie_regulator_disable(pcie);
>  	clk_disable_unprepare(pcie->clk);
> -	clk_put(pcie->clk);
>  }
>  
>  static int brcm_pcie_remove(struct platform_device *pdev)
>
Nicolas Saenz Julienne Feb. 14, 2020, 10:55 a.m. UTC | #2
On Thu Feb 13, 2020 at 11:59 AM, Jaedon Shin wrote:
> devm_clk_get* APIs are device managed and get freed automatically when
> the device detaches. so there is no reason to explicitly call clk_put()
> in probe or remove functions.
>
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---

Acked-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>

Thanks!

> drivers/pci/controller/pcie-brcmstb.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pcie-brcmstb.c
> b/drivers/pci/controller/pcie-brcmstb.c
> index 0e0ca39a680b..3e48d9e238bb 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -972,7 +972,6 @@ static void __brcm_pcie_remove(struct brcm_pcie
> *pcie)
> brcm_pcie_turn_off(pcie);
> brcm_pcie_regulator_disable(pcie);
> clk_disable_unprepare(pcie->clk);
> - clk_put(pcie->clk);
> }
>  
> static int brcm_pcie_remove(struct platform_device *pdev)
> --
> 2.21.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Patch
diff mbox series

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 0e0ca39a680b..3e48d9e238bb 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -972,7 +972,6 @@  static void __brcm_pcie_remove(struct brcm_pcie *pcie)
 	brcm_pcie_turn_off(pcie);
 	brcm_pcie_regulator_disable(pcie);
 	clk_disable_unprepare(pcie->clk);
-	clk_put(pcie->clk);
 }
 
 static int brcm_pcie_remove(struct platform_device *pdev)