mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] phy: tegra: Use PTR_ERR_OR_ZERO() to simplify code
@ 2020-05-05 15:00 Aishwarya Ramakrishnan
  2020-05-06 11:47 ` Vidya Sagar
  0 siblings, 1 reply; 3+ messages in thread
From: Aishwarya Ramakrishnan @ 2020-05-05 15:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Thierry Reding, Jonathan Hunter,
	Aishwarya Ramakrishnan, Lorenzo Pieralisi, Vidya Sagar,
	linux-kernel, linux-tegra

PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR.

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
---
 drivers/phy/tegra/phy-tegra194-p2u.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/phy/tegra/phy-tegra194-p2u.c b/drivers/phy/tegra/phy-tegra194-p2u.c
index 7042bed9feaa..42394d27f4cb 100644
--- a/drivers/phy/tegra/phy-tegra194-p2u.c
+++ b/drivers/phy/tegra/phy-tegra194-p2u.c
@@ -92,10 +92,7 @@ static int tegra_p2u_probe(struct platform_device *pdev)
 	phy_set_drvdata(generic_phy, phy);
 
 	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
-	if (IS_ERR(phy_provider))
-		return PTR_ERR(phy_provider);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
 static const struct of_device_id tegra_p2u_id_table[] = {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-06 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 15:00 [PATCH] phy: tegra: Use PTR_ERR_OR_ZERO() to simplify code Aishwarya Ramakrishnan
2020-05-06 11:47 ` Vidya Sagar
2020-05-06 15:40   ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®