All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe()
@ 2018-10-10  2:00 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-10-10  1:49 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, David S. Miller, Quentin Schulz
  Cc: Wei Yongjun, linux-kernel, kernel-janitors, netdev

In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/phy/mscc/phy-ocelot-serdes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/mscc/phy-ocelot-serdes.c b/drivers/phy/mscc/phy-ocelot-serdes.c
index 8936abd..b2be546 100644
--- a/drivers/phy/mscc/phy-ocelot-serdes.c
+++ b/drivers/phy/mscc/phy-ocelot-serdes.c
@@ -257,8 +257,8 @@ static int serdes_probe(struct platform_device *pdev)
 
 	ctrl->dev = &pdev->dev;
 	ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node);
-	if (!ctrl->regs)
-		return -ENODEV;
+	if (IS_ERR(ctrl->regs))
+		return PTR_ERR(ctrl->regs);
 
 	for (i = 0; i <= SERDES_MAX; i++) {
 		ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]);

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

* [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe()
@ 2018-10-10  2:00 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-10-10  2:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, David S. Miller, Quentin Schulz
  Cc: Wei Yongjun, linux-kernel, kernel-janitors, netdev

In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/phy/mscc/phy-ocelot-serdes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/mscc/phy-ocelot-serdes.c b/drivers/phy/mscc/phy-ocelot-serdes.c
index 8936abd..b2be546 100644
--- a/drivers/phy/mscc/phy-ocelot-serdes.c
+++ b/drivers/phy/mscc/phy-ocelot-serdes.c
@@ -257,8 +257,8 @@ static int serdes_probe(struct platform_device *pdev)
 
 	ctrl->dev = &pdev->dev;
 	ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node);
-	if (!ctrl->regs)
-		return -ENODEV;
+	if (IS_ERR(ctrl->regs))
+		return PTR_ERR(ctrl->regs);
 
 	for (i = 0; i <= SERDES_MAX; i++) {
 		ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]);


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

* Re: [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe()
  2018-10-10  2:00 ` Wei Yongjun
@ 2018-10-10  6:43   ` Quentin Schulz
  -1 siblings, 0 replies; 6+ messages in thread
From: Quentin Schulz @ 2018-10-10  6:43 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Kishon Vijay Abraham I, David S. Miller, linux-kernel,
	kernel-janitors, netdev

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

Hi Wei Yongjun,

On Wed, Oct 10, 2018 at 02:00:24AM +0000, Wei Yongjun wrote:
> In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
> 
> Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing")

Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com>

Thanks!
Quentin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe()
@ 2018-10-10  6:43   ` Quentin Schulz
  0 siblings, 0 replies; 6+ messages in thread
From: Quentin Schulz @ 2018-10-10  6:43 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Kishon Vijay Abraham I, David S. Miller, linux-kernel,
	kernel-janitors, netdev

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

Hi Wei Yongjun,

On Wed, Oct 10, 2018 at 02:00:24AM +0000, Wei Yongjun wrote:
> In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
> 
> Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing")

Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com>

Thanks!
Quentin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe()
  2018-10-10  2:00 ` Wei Yongjun
@ 2018-10-11  5:54   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-10-11  5:54 UTC (permalink / raw)
  To: weiyongjun1; +Cc: kishon, quentin.schulz, linux-kernel, kernel-janitors, netdev

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 10 Oct 2018 02:00:24 +0000

> In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
> 
> Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.

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

* Re: [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe()
@ 2018-10-11  5:54   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-10-11  5:54 UTC (permalink / raw)
  To: weiyongjun1; +Cc: kishon, quentin.schulz, linux-kernel, kernel-janitors, netdev

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 10 Oct 2018 02:00:24 +0000

> In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
> 
> Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.

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

end of thread, other threads:[~2018-10-11  5:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10  1:49 [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe() Wei Yongjun
2018-10-10  2:00 ` Wei Yongjun
2018-10-10  6:43 ` Quentin Schulz
2018-10-10  6:43   ` Quentin Schulz
2018-10-11  5:54 ` David Miller
2018-10-11  5:54   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.