* [PATCH] c2port: checking for NULL instead of IS_ERR()
@ 2017-04-12 8:33 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-04-12 8:33 UTC (permalink / raw)
To: linux-kernel, Rodolfo Giometti; +Cc: kernel-janitors, Andrew Morton
c2port_device_register() never returns NULL, it uses error pointers.
Fixes: 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/misc/c2port/c2port-duramar2150.c b/drivers/misc/c2port/c2port-duramar2150.c
index 5484301d57d9..3dc61ea7dc64 100644
--- a/drivers/misc/c2port/c2port-duramar2150.c
+++ b/drivers/misc/c2port/c2port-duramar2150.c
@@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void)
duramar2150_c2port_dev = c2port_device_register("uc",
&duramar2150_c2port_ops, NULL);
- if (!duramar2150_c2port_dev) {
- ret = -ENODEV;
+ if (IS_ERR(duramar2150_c2port_dev)) {
+ ret = PTR_ERR(duramar2150_c2port_dev);
goto free_region;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] c2port: checking for NULL instead of IS_ERR()
@ 2017-04-12 8:33 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-04-12 8:33 UTC (permalink / raw)
To: linux-kernel, Rodolfo Giometti; +Cc: kernel-janitors, Andrew Morton
c2port_device_register() never returns NULL, it uses error pointers.
Fixes: 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/misc/c2port/c2port-duramar2150.c b/drivers/misc/c2port/c2port-duramar2150.c
index 5484301d57d9..3dc61ea7dc64 100644
--- a/drivers/misc/c2port/c2port-duramar2150.c
+++ b/drivers/misc/c2port/c2port-duramar2150.c
@@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void)
duramar2150_c2port_dev = c2port_device_register("uc",
&duramar2150_c2port_ops, NULL);
- if (!duramar2150_c2port_dev) {
- ret = -ENODEV;
+ if (IS_ERR(duramar2150_c2port_dev)) {
+ ret = PTR_ERR(duramar2150_c2port_dev);
goto free_region;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] c2port: checking for NULL instead of IS_ERR()
2017-04-12 8:33 ` Dan Carpenter
@ 2017-04-12 9:18 ` Rodolfo Giometti
-1 siblings, 0 replies; 4+ messages in thread
From: Rodolfo Giometti @ 2017-04-12 9:18 UTC (permalink / raw)
To: Dan Carpenter, linux-kernel, Rodolfo Giometti
Cc: kernel-janitors, Andrew Morton
On 04/12/17 10:33, Dan Carpenter wrote:
> c2port_device_register() never returns NULL, it uses error pointers.
>
> Fixes: 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rodolfo Giometti <giometti@linux.it>
> diff --git a/drivers/misc/c2port/c2port-duramar2150.c b/drivers/misc/c2port/c2port-duramar2150.c
> index 5484301d57d9..3dc61ea7dc64 100644
> --- a/drivers/misc/c2port/c2port-duramar2150.c
> +++ b/drivers/misc/c2port/c2port-duramar2150.c
> @@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void)
>
> duramar2150_c2port_dev = c2port_device_register("uc",
> &duramar2150_c2port_ops, NULL);
> - if (!duramar2150_c2port_dev) {
> - ret = -ENODEV;
> + if (IS_ERR(duramar2150_c2port_dev)) {
> + ret = PTR_ERR(duramar2150_c2port_dev);
> goto free_region;
> }
>
>
--
HCE Engineering e-mail: giometti@hce-engineering.com
GNU/Linux Solutions giometti@enneenne.com
Linux Device Driver giometti@linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Cosino Project - the quick prototyping embedded system - www.cosino.io
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] c2port: checking for NULL instead of IS_ERR()
@ 2017-04-12 9:18 ` Rodolfo Giometti
0 siblings, 0 replies; 4+ messages in thread
From: Rodolfo Giometti @ 2017-04-12 9:18 UTC (permalink / raw)
To: Dan Carpenter, linux-kernel, Rodolfo Giometti
Cc: kernel-janitors, Andrew Morton
On 04/12/17 10:33, Dan Carpenter wrote:
> c2port_device_register() never returns NULL, it uses error pointers.
>
> Fixes: 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rodolfo Giometti <giometti@linux.it>
> diff --git a/drivers/misc/c2port/c2port-duramar2150.c b/drivers/misc/c2port/c2port-duramar2150.c
> index 5484301d57d9..3dc61ea7dc64 100644
> --- a/drivers/misc/c2port/c2port-duramar2150.c
> +++ b/drivers/misc/c2port/c2port-duramar2150.c
> @@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void)
>
> duramar2150_c2port_dev = c2port_device_register("uc",
> &duramar2150_c2port_ops, NULL);
> - if (!duramar2150_c2port_dev) {
> - ret = -ENODEV;
> + if (IS_ERR(duramar2150_c2port_dev)) {
> + ret = PTR_ERR(duramar2150_c2port_dev);
> goto free_region;
> }
>
>
--
HCE Engineering e-mail: giometti@hce-engineering.com
GNU/Linux Solutions giometti@enneenne.com
Linux Device Driver giometti@linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Cosino Project - the quick prototyping embedded system - www.cosino.io
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-12 9:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 8:33 [PATCH] c2port: checking for NULL instead of IS_ERR() Dan Carpenter
2017-04-12 8:33 ` Dan Carpenter
2017-04-12 9:18 ` Rodolfo Giometti
2017-04-12 9:18 ` Rodolfo Giometti
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.