diff mbox series

[5/7] PCI: tegra: Convert to devm_of_phy_optional_get()

Message ID e9e0aa207d531ccea00e8947678a4f6ce1c625ac.1674036164.git.geert+renesas@glider.be
State Superseded
Headers show
Series phy: Add devm_of_phy_optional_get() helper | expand

Commit Message

Geert Uytterhoeven Jan. 18, 2023, 10:15 a.m. UTC
Use the new devm_of_phy_optional_get() helper instead of open-coding the
same operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/pci/controller/pci-tegra.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Bjorn Helgaas Jan. 23, 2023, 6:17 p.m. UTC | #1
On Wed, Jan 18, 2023 at 11:15:18AM +0100, Geert Uytterhoeven wrote:
> Use the new devm_of_phy_optional_get() helper instead of open-coding the
> same operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks!

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Let me know if you want me to apply; otherwise I'll assume you will
merge along with the [1/7] patch.

> ---
>  drivers/pci/controller/pci-tegra.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
> index 929f9363e94bec71..5b8907c663e516ad 100644
> --- a/drivers/pci/controller/pci-tegra.c
> +++ b/drivers/pci/controller/pci-tegra.c
> @@ -1330,12 +1330,9 @@ static struct phy *devm_of_phy_optional_get_index(struct device *dev,
>  	if (!name)
>  		return ERR_PTR(-ENOMEM);
>  
> -	phy = devm_of_phy_get(dev, np, name);
> +	phy = devm_of_phy_optional_get(dev, np, name);
>  	kfree(name);
>  
> -	if (PTR_ERR(phy) == -ENODEV)
> -		phy = NULL;
> -
>  	return phy;
>  }
>  
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox series

Patch

diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 929f9363e94bec71..5b8907c663e516ad 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -1330,12 +1330,9 @@  static struct phy *devm_of_phy_optional_get_index(struct device *dev,
 	if (!name)
 		return ERR_PTR(-ENOMEM);
 
-	phy = devm_of_phy_get(dev, np, name);
+	phy = devm_of_phy_optional_get(dev, np, name);
 	kfree(name);
 
-	if (PTR_ERR(phy) == -ENODEV)
-		phy = NULL;
-
 	return phy;
 }