Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1728756

[PATCH net] phy: mvebu-cp110: checking for NULL instead of IS_ERR()

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [PATCH net] phy: mvebu-cp110: checking for NULL instead of IS_ERR()
Date 2017-09-08 12:40 +0200
Message-ID <unoRA-5F0-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


devm_ioremap_resource() never returns NULL, it only returns error
pointers so this test needs to be changed.

Fixes: d0438bd6aa09 ("phy: add the mvebu cp110 comphy driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This driver apparently is going through the net tree, but netdev isn't
listed as handling it in MAINTAINERS.  Kishon, do you know what's up
with that?

diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
index 73ebad6634a7..24578bd68ddc 100644
--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
@@ -576,8 +576,8 @@ static int mvebu_comphy_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->regmap);
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	priv->base = devm_ioremap_resource(&pdev->dev, res);
-	if (!priv->base)
-		return -ENOMEM;
+	if (IS_ERR(priv->base))
+		return PTR_ERR(priv->base);
 
 	for_each_available_child_of_node(pdev->dev.of_node, child) {
 		struct mvebu_comphy_lane *lane;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH net] phy: mvebu-cp110: checking for NULL instead of IS_ERR() Dan Carpenter <dan.carpenter@oracle.com> - 2017-09-08 12:40 +0200
  Re: [PATCH net] phy: mvebu-cp110: checking for NULL instead of  IS_ERR() David Miller <davem@davemloft.net> - 2017-09-09 06:10 +0200

csiph-web