linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsi: occ: fix a NULL vs IS_ERR() check
@ 2018-11-26  8:11 Dan Carpenter
  2018-11-26 16:03 ` Eddie James
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-11-26  8:11 UTC (permalink / raw)
  To: Andrew Jeffery, Eddie James
  Cc: Guenter Roeck, Andrew Jeffery, linux-kernel, kernel-janitors

The platform_device_register_full() function doesn't return NULL, it
returns error pointers.

Fixes: 4e01f5644463 ("fsi: Add On-Chip Controller (OCC) driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/fsi/fsi-occ.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
index a2301cea1cbb..d8695f67622f 100644
--- a/drivers/fsi/fsi-occ.c
+++ b/drivers/fsi/fsi-occ.c
@@ -546,7 +546,7 @@ static int occ_probe(struct platform_device *pdev)
 
 	hwmon_dev_info.id = occ->idx;
 	hwmon_dev = platform_device_register_full(&hwmon_dev_info);
-	if (!hwmon_dev)
+	if (IS_ERR(hwmon_dev))
 		dev_warn(dev, "failed to create hwmon device\n");
 
 	return 0;
-- 
2.11.0


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

* Re: [PATCH] fsi: occ: fix a NULL vs IS_ERR() check
  2018-11-26  8:11 [PATCH] fsi: occ: fix a NULL vs IS_ERR() check Dan Carpenter
@ 2018-11-26 16:03 ` Eddie James
  0 siblings, 0 replies; 2+ messages in thread
From: Eddie James @ 2018-11-26 16:03 UTC (permalink / raw)
  To: Dan Carpenter, Andrew Jeffery
  Cc: Guenter Roeck, linux-kernel, kernel-janitors



On 11/26/2018 02:11 AM, Dan Carpenter wrote:
> The platform_device_register_full() function doesn't return NULL, it
> returns error pointers.
>
> Fixes: 4e01f5644463 ("fsi: Add On-Chip Controller (OCC) driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks.

Reviewed-by: Eddie James <eajames@linux.ibm.com>

> ---
>   drivers/fsi/fsi-occ.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
> index a2301cea1cbb..d8695f67622f 100644
> --- a/drivers/fsi/fsi-occ.c
> +++ b/drivers/fsi/fsi-occ.c
> @@ -546,7 +546,7 @@ static int occ_probe(struct platform_device *pdev)
>
>   	hwmon_dev_info.id = occ->idx;
>   	hwmon_dev = platform_device_register_full(&hwmon_dev_info);
> -	if (!hwmon_dev)
> +	if (IS_ERR(hwmon_dev))
>   		dev_warn(dev, "failed to create hwmon device\n");
>
>   	return 0;


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

end of thread, other threads:[~2018-11-26 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26  8:11 [PATCH] fsi: occ: fix a NULL vs IS_ERR() check Dan Carpenter
2018-11-26 16:03 ` Eddie James

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).