From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Biju Das <biju.das@bp.renesas.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2] usb: typec: fix an IS_ERR() vs NULL bug in hd3ss3220_probe()
Date: Mon, 14 Oct 2019 14:00:04 +0300 [thread overview]
Message-ID: <20191014110004.GA17542@kuha.fi.intel.com> (raw)
In-Reply-To: <20191011185055.GA20972@mwanda>
On Fri, Oct 11, 2019 at 09:50:55PM +0300, Dan Carpenter wrote:
> The device_get_named_child_node() function doesn't return error
> pointers, it returns NULL on error.
>
> Fixes: 1c48c759ef4b ("usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> v2: remove -ENODEV instead of -EIO
>
> drivers/usb/typec/hd3ss3220.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
> index 9715600aeb04..8afaf5768a17 100644
> --- a/drivers/usb/typec/hd3ss3220.c
> +++ b/drivers/usb/typec/hd3ss3220.c
> @@ -172,8 +172,8 @@ static int hd3ss3220_probe(struct i2c_client *client,
> hd3ss3220_set_source_pref(hd3ss3220,
> HD3SS3220_REG_GEN_CTRL_SRC_PREF_DRP_DEFAULT);
> connector = device_get_named_child_node(hd3ss3220->dev, "connector");
> - if (IS_ERR(connector))
> - return PTR_ERR(connector);
> + if (!connector)
> + return -ENODEV;
>
> hd3ss3220->role_sw = fwnode_usb_role_switch_get(connector);
> fwnode_handle_put(connector);
> --
> 2.20.1
thanks,
--
heikki
prev parent reply other threads:[~2019-10-14 11:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 13:35 [PATCH] usb: typec: fix an IS_ERR() vs NULL bug in hd3ss3220_probe() Dan Carpenter
2019-10-11 13:59 ` Heikki Krogerus
2019-10-11 18:50 ` [PATCH v2] " Dan Carpenter
2019-10-14 11:00 ` Heikki Krogerus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191014110004.GA17542@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=biju.das@bp.renesas.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).