linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
@ 2019-08-26 12:00 Wei Yongjun
  2019-08-26 13:03 ` Dan Carpenter
  2019-08-26 23:40 ` Andrew Jeffery
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-08-26 12:00 UTC (permalink / raw)
  To: Adrian Hunter, Ulf Hansson, Joel Stanley, Andrew Jeffery
  Cc: linux-mmc, kernel-janitors, Wei Yongjun, linux-aspeed,
	linux-arm-kernel

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

Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/mmc/host/sdhci-of-aspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
index 8bb095ca2fa9..d5acb5afc50f 100644
--- a/drivers/mmc/host/sdhci-of-aspeed.c
+++ b/drivers/mmc/host/sdhci-of-aspeed.c
@@ -261,9 +261,9 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
 		struct platform_device *cpdev;
 
 		cpdev = of_platform_device_create(child, NULL, &pdev->dev);
-		if (IS_ERR(cpdev)) {
+		if (!cpdev) {
 			of_node_put(child);
-			ret = PTR_ERR(cpdev);
+			ret = -ENODEV;
 			goto err_clk;
 		}
 	}




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-08-27 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-26 12:00 [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe() Wei Yongjun
2019-08-26 13:03 ` Dan Carpenter
2019-08-26 23:37   ` Andrew Jeffery
2019-08-27  0:47     ` Julia Lawall
2019-08-27 13:49       ` Ulf Hansson
2019-08-26 23:40 ` Andrew Jeffery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).