[PATCH] PCI: histb: Remove an unneeded NULL test in histb_pcie_remove()

Christophe JAILLET posted 1 patch 9 months ago
drivers/pci/controller/dwc/pcie-histb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] PCI: histb: Remove an unneeded NULL test in histb_pcie_remove()
Posted by Christophe JAILLET 9 months ago
phy_exit() handles NULL as a parameter, so there is no need for an extra
test.
This makes the code consistent with the error handling path of the probe.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Follow up to commit d8dba4a635bc, where the NULL check from the patch in
the Link: was removed when applied.
---
 drivers/pci/controller/dwc/pcie-histb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-histb.c b/drivers/pci/controller/dwc/pcie-histb.c
index d84e46ca4490..1f2f4c28a949 100644
--- a/drivers/pci/controller/dwc/pcie-histb.c
+++ b/drivers/pci/controller/dwc/pcie-histb.c
@@ -432,8 +432,7 @@ static void histb_pcie_remove(struct platform_device *pdev)
 
 	histb_pcie_host_disable(hipcie);
 
-	if (hipcie->phy)
-		phy_exit(hipcie->phy);
+	phy_exit(hipcie->phy);
 }
 
 static const struct of_device_id histb_pcie_of_match[] = {
-- 
2.48.1
Re: [PATCH] PCI: histb: Remove an unneeded NULL test in histb_pcie_remove()
Posted by Krzysztof Wilczyński 9 months ago
Hello,

> phy_exit() handles NULL as a parameter, so there is no need for an extra
> test.
> This makes the code consistent with the error handling path of the probe.

Thank you for the due diligence here!  Much appreciated.

I squashed this patch against the changes already on the branch.

Thank you!

	Krzysztof