From: Guenter Roeck <groeck@google.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Collabora Kernel ML <kernel@collabora.com>,
Guenter Roeck <groeck@chromium.org>,
Benson Leung <bleung@chromium.org>,
Dmitry Torokhov <dtor@chromium.org>,
fparent@baylibre.com, Linux PM list <linux-pm@vger.kernel.org>,
Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH] power: supply: cros_usbpd: Remove dev_err() getting the number of ports
Date: Fri, 29 Nov 2019 14:02:37 -0800 [thread overview]
Message-ID: <CABXOdTef5QAmZosDFF0Av8=9etj46O6aoxM3k9M9YBJmJynASA@mail.gmail.com> (raw)
In-Reply-To: <20191129215916.17105-1-enric.balletbo@collabora.com>
On Fri, Nov 29, 2019 at 1:59 PM Enric Balletbo i Serra
<enric.balletbo@collabora.com> wrote:
>
> When a device has no support to get the charger number of ports, it
> doesn't have to result in a dev_err(), print saying "Could not get
> charger port count" using a dev_info() would suffice. In such case,
> the dev_info() message is already printed but the dev_err() is annoying,
> specially, on those devices that doesn't support the command. So remove
> the dev_err().
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
>
> drivers/power/supply/cros_usbpd-charger.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c
> index 6cc7c3910e09..ffad9ee03a68 100644
> --- a/drivers/power/supply/cros_usbpd-charger.c
> +++ b/drivers/power/supply/cros_usbpd-charger.c
> @@ -132,11 +132,8 @@ static int cros_usbpd_charger_get_num_ports(struct charger_data *charger)
> ret = cros_usbpd_charger_ec_command(charger, 0,
> EC_CMD_CHARGE_PORT_COUNT,
> NULL, 0, &resp, sizeof(resp));
> - if (ret < 0) {
> - dev_err(charger->dev,
> - "Unable to get the number of ports (err:0x%x)\n", ret);
> + if (ret < 0)
> return ret;
> - }
>
> return resp.port_count;
> }
> @@ -148,11 +145,8 @@ static int cros_usbpd_charger_get_usbpd_num_ports(struct charger_data *charger)
>
> ret = cros_usbpd_charger_ec_command(charger, 0, EC_CMD_USB_PD_PORTS,
> NULL, 0, &resp, sizeof(resp));
> - if (ret < 0) {
> - dev_err(charger->dev,
> - "Unable to get the number or ports (err:0x%x)\n", ret);
> + if (ret < 0)
> return ret;
> - }
>
> return resp.num_ports;
> }
> --
> 2.20.1
>
next prev parent reply other threads:[~2019-11-29 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 21:59 [PATCH] power: supply: cros_usbpd: Remove dev_err() getting the number of ports Enric Balletbo i Serra
2019-11-29 22:02 ` Guenter Roeck [this message]
2019-12-19 1:00 ` Sebastian Reichel
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='CABXOdTef5QAmZosDFF0Av8=9etj46O6aoxM3k9M9YBJmJynASA@mail.gmail.com' \
--to=groeck@google.com \
--cc=bleung@chromium.org \
--cc=dtor@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=fparent@baylibre.com \
--cc=groeck@chromium.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@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).