* [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-23 11:23 ` Dan Carpenter
0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-10-23 11:23 UTC (permalink / raw)
To: Heikki Krogerus, Amelie Delaunay
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
The typec_register_port() function doesn't return error pointers, it
returns error pointers.
Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/usb/typec/stusb160x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index ce0bd7b3ad88..f7369e371dd4 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
}
chip->port = typec_register_port(chip->dev, &chip->capability);
- if (!chip->port) {
- ret = -ENODEV;
+ if (IS_ERR(chip->port)) {
+ ret = PTR_ERR(chip->port);
goto all_reg_disable;
}
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-23 11:23 ` Dan Carpenter
0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-10-23 11:23 UTC (permalink / raw)
To: Heikki Krogerus, Amelie Delaunay
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
The typec_register_port() function doesn't return error pointers, it
returns error pointers.
Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/usb/typec/stusb160x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index ce0bd7b3ad88..f7369e371dd4 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
}
chip->port = typec_register_port(chip->dev, &chip->capability);
- if (!chip->port) {
- ret = -ENODEV;
+ if (IS_ERR(chip->port)) {
+ ret = PTR_ERR(chip->port);
goto all_reg_disable;
}
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
2020-10-23 11:23 ` Dan Carpenter
@ 2020-10-23 11:40 ` Dan Carpenter
-1 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-10-23 11:40 UTC (permalink / raw)
To: Heikki Krogerus, Amelie Delaunay
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
The typec_register_port() function doesn't return NULL, it returns error
pointers.
Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
Thanks, Walter!
drivers/usb/typec/stusb160x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index ce0bd7b3ad88..f7369e371dd4 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
}
chip->port = typec_register_port(chip->dev, &chip->capability);
- if (!chip->port) {
- ret = -ENODEV;
+ if (IS_ERR(chip->port)) {
+ ret = PTR_ERR(chip->port);
goto all_reg_disable;
}
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-23 11:40 ` Dan Carpenter
0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-10-23 11:40 UTC (permalink / raw)
To: Heikki Krogerus, Amelie Delaunay
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
The typec_register_port() function doesn't return NULL, it returns error
pointers.
Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
Thanks, Walter!
drivers/usb/typec/stusb160x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index ce0bd7b3ad88..f7369e371dd4 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
}
chip->port = typec_register_port(chip->dev, &chip->capability);
- if (!chip->port) {
- ret = -ENODEV;
+ if (IS_ERR(chip->port)) {
+ ret = PTR_ERR(chip->port);
goto all_reg_disable;
}
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
2020-10-23 11:23 ` Dan Carpenter
@ 2020-10-23 13:56 ` Sergei Shtylyov
-1 siblings, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2020-10-23 13:56 UTC (permalink / raw)
To: Dan Carpenter, Heikki Krogerus, Amelie Delaunay
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
Hello!
On 10/23/20 2:23 PM, Dan Carpenter wrote:
> The typec_register_port() function doesn't return error pointers, it
s/error/NULL/, maybe? :-)
> returns error pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
MBR, Sergei
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-23 13:56 ` Sergei Shtylyov
0 siblings, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2020-10-23 13:56 UTC (permalink / raw)
To: Dan Carpenter, Heikki Krogerus, Amelie Delaunay
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
Hello!
On 10/23/20 2:23 PM, Dan Carpenter wrote:
> The typec_register_port() function doesn't return error pointers, it
s/error/NULL/, maybe? :-)
> returns error pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
MBR, Sergei
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
2020-10-23 11:23 ` Dan Carpenter
@ 2020-10-26 10:50 ` Heikki Krogerus
-1 siblings, 0 replies; 12+ messages in thread
From: Heikki Krogerus @ 2020-10-26 10:50 UTC (permalink / raw)
To: Dan Carpenter
Cc: Amelie Delaunay, Greg Kroah-Hartman, linux-usb, kernel-janitors
On Fri, Oct 23, 2020 at 02:23:47PM +0300, Dan Carpenter wrote:
> The typec_register_port() function doesn't return error pointers, it
> returns error pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
You do need to fix the commit message like Sergei pointed out.
Otherwise, FWIW:
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
> --
> 2.28.0
thanks,
--
heikki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-26 10:50 ` Heikki Krogerus
0 siblings, 0 replies; 12+ messages in thread
From: Heikki Krogerus @ 2020-10-26 10:50 UTC (permalink / raw)
To: Dan Carpenter
Cc: Amelie Delaunay, Greg Kroah-Hartman, linux-usb, kernel-janitors
On Fri, Oct 23, 2020 at 02:23:47PM +0300, Dan Carpenter wrote:
> The typec_register_port() function doesn't return error pointers, it
> returns error pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
You do need to fix the commit message like Sergei pointed out.
Otherwise, FWIW:
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
> --
> 2.28.0
thanks,
--
heikki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
2020-10-23 11:40 ` Dan Carpenter
@ 2020-10-26 10:52 ` Heikki Krogerus
-1 siblings, 0 replies; 12+ messages in thread
From: Heikki Krogerus @ 2020-10-26 10:52 UTC (permalink / raw)
To: Dan Carpenter
Cc: Amelie Delaunay, Greg Kroah-Hartman, linux-usb, kernel-janitors
On Fri, Oct 23, 2020 at 02:40:17PM +0300, Dan Carpenter wrote:
> The typec_register_port() function doesn't return NULL, it returns error
> pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Ah, sorry. You had already fixed the commit message.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
> Thanks, Walter!
>
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
> --
> 2.28.0
thanks,
--
heikki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-26 10:52 ` Heikki Krogerus
0 siblings, 0 replies; 12+ messages in thread
From: Heikki Krogerus @ 2020-10-26 10:52 UTC (permalink / raw)
To: Dan Carpenter
Cc: Amelie Delaunay, Greg Kroah-Hartman, linux-usb, kernel-janitors
On Fri, Oct 23, 2020 at 02:40:17PM +0300, Dan Carpenter wrote:
> The typec_register_port() function doesn't return NULL, it returns error
> pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Ah, sorry. You had already fixed the commit message.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
> Thanks, Walter!
>
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
> --
> 2.28.0
thanks,
--
heikki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
2020-10-23 11:40 ` Dan Carpenter
@ 2020-10-28 12:29 ` Amelie DELAUNAY
-1 siblings, 0 replies; 12+ messages in thread
From: Amelie DELAUNAY @ 2020-10-28 12:29 UTC (permalink / raw)
To: Dan Carpenter, Heikki Krogerus
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
Hi Dan,
Thanks for the patch!
On 10/23/20 1:40 PM, Dan Carpenter wrote:
> The typec_register_port() function doesn't return NULL, it returns error
> pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>
> ---
> v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
> Thanks, Walter!
>
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
@ 2020-10-28 12:29 ` Amelie DELAUNAY
0 siblings, 0 replies; 12+ messages in thread
From: Amelie DELAUNAY @ 2020-10-28 12:29 UTC (permalink / raw)
To: Dan Carpenter, Heikki Krogerus
Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors
Hi Dan,
Thanks for the patch!
On 10/23/20 1:40 PM, Dan Carpenter wrote:
> The typec_register_port() function doesn't return NULL, it returns error
> pointers.
>
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>
> ---
> v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
> Thanks, Walter!
>
> drivers/usb/typec/stusb160x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index ce0bd7b3ad88..f7369e371dd4 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client)
> }
>
> chip->port = typec_register_port(chip->dev, &chip->capability);
> - if (!chip->port) {
> - ret = -ENODEV;
> + if (IS_ERR(chip->port)) {
> + ret = PTR_ERR(chip->port);
> goto all_reg_disable;
> }
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-10-28 21:51 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23 11:23 [PATCH 1/2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe Dan Carpenter
2020-10-23 11:23 ` Dan Carpenter
2020-10-23 11:40 ` [PATCH 1/2 v2] " Dan Carpenter
2020-10-23 11:40 ` Dan Carpenter
2020-10-26 10:52 ` Heikki Krogerus
2020-10-26 10:52 ` Heikki Krogerus
2020-10-28 12:29 ` Amelie DELAUNAY
2020-10-28 12:29 ` Amelie DELAUNAY
2020-10-23 13:56 ` [PATCH 1/2] " Sergei Shtylyov
2020-10-23 13:56 ` Sergei Shtylyov
2020-10-26 10:50 ` Heikki Krogerus
2020-10-26 10:50 ` Heikki Krogerus
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.