Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8639978ybc; Fri, 29 Nov 2019 14:07:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxqomKQGwlk9YQuU7u08KTt+qsiuyXWG811h8AjG49znkQfk/FKx7AteVuYFfYHu9qFtyhx X-Received: by 2002:a17:906:248f:: with SMTP id e15mr2889965ejb.141.1575065220097; Fri, 29 Nov 2019 14:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575065220; cv=none; d=google.com; s=arc-20160816; b=UAz9y2WMYoQENq9eIXoIFPA7oqSYCtM1pCX6jyieKbKR5HKvwU3hnnCuyi2wSdq9Iw QEzGe3d4S8eatPo9FI4n0hwBvGgiwTD0PqCfZX7kGUzY8QRIyHbHfEpgg1vdRfZrYvJ7 1/qVGt9KJDEZ83XkgRRo8FP7ygCp5d51siIp+VtUUC3JsfqDFaZw9ivabVKT00hmyVy9 dpoeiG6guVenfzciFWW4e1M5s+kaBuOHjiCpaUotPIyr7KT8BY+GM39OsrSKKkyRmNyE xsiOtbDzp3I+w/dvkbY/INZNcWURIRwKf1h5BbjaP0cZmisYFhN7hM43QEuFMt/mM8BE qVXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gBFfyve4zeh4DVhdr4q4ORn0Yl45pSjl2PrBaMrz/4E=; b=gZjAa1cTQaznDFO6pLzjsonvVvEe/5Ae2yhEJIQU7R7FTmaV6ftKbhoiXUhc1NAbB7 X1/uPzkNM0jlNxEkGiihtgFchArnZYyF11WCbGpcOftLnfdVj9a+GAUHabBYgItup/vW GsBrAejx8eZ2fJZYkNQ28454rG/qrT1jUWpGltDhUErx8Sbv9HMGObzuSTBWRVD8LHIL j+T7eqj8qYccUCQURoXLtGkjvuDbAG7TscEZQNyEIfAnDyAKZ0TCFxB+BfPOSwu5T7ok XxvwhBKYqsgD8QHKhVKLOe8ucUH2H/SnNf7TYFwX48pjb+nR1We+jzgJS241RFzsy6qC ZrGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=t7YKNY5W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si6276878edn.239.2019.11.29.14.06.35; Fri, 29 Nov 2019 14:07:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=t7YKNY5W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387393AbfK2WCv (ORCPT + 99 others); Fri, 29 Nov 2019 17:02:51 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:41093 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbfK2WCu (ORCPT ); Fri, 29 Nov 2019 17:02:50 -0500 Received: by mail-yb1-f196.google.com with SMTP id d95so12025459ybi.8 for ; Fri, 29 Nov 2019 14:02:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gBFfyve4zeh4DVhdr4q4ORn0Yl45pSjl2PrBaMrz/4E=; b=t7YKNY5WqMWU/jvRye+X2w55JXFkqSZaPNDtaeQ0Uc469ILUEST4j4sCN/RfDUVJRt WpHgyhgG/L6zG7v/G6NjTZ9+A5ME+lSZDvvJx/EWm0BiPFe5QbtohCKnSaQJJOXl8oRN WW1oSZC9jFwjD8CqbpWQoGsGJdvDfgkAKDJjWltMV5iNBkecIhw0JMBFfXA20A1TzHxW pbwS6XJtOcjbTrqjLjU7/on7XogtzX1Wb5yaUCml5v0+PvbByZsqDF/HFsevw8Qo7LCZ st79wvz+Mraflp10AvIyoI6pAjMKAHeFWzTfnCgivIPLoomMAwzdW6MswGGhH/AudVMj yM9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gBFfyve4zeh4DVhdr4q4ORn0Yl45pSjl2PrBaMrz/4E=; b=co1wZurA6ZmBnnM3xAMC3LcrO3tMg0vTXBkySCSZJPTvq7c6w1jg57NrXoKLj9NeNw owMhi83CfX+AmUbhtZhgB5IJspNuzqsuwdqL4KVO9P0ENNpZzd9U/SqH9EHG7WvBLFxk wPb0Wk+jNinj9KDFBQAbthdKBDg/YmpfdGVfe7yhab6dqfhpCdCd/MXFgIm0LlkyqAk8 bDiI32tjHG9krfavQYcPEK58v5xHm2Wd5qaWeJ7wMosu5Uul31BaTCvTofGNRbjyFNza dhKoMRjfXt+a2MbW8azf5oJiLZTvZar5Yo2oxNEtu7EdWmBahPNWLZuqCS9yz72RYu4l 3qYA== X-Gm-Message-State: APjAAAWaEfBLT9Ye0j6etVXiRP+CR577m8enQfOxJoWZU+47uvoNJdsX seg4agokGnnB2v42M39Wc53WYV1oBylX9KH/5MzRFoUx X-Received: by 2002:a25:1909:: with SMTP id 9mr11484703ybz.61.1575064968117; Fri, 29 Nov 2019 14:02:48 -0800 (PST) MIME-Version: 1.0 References: <20191129215916.17105-1-enric.balletbo@collabora.com> In-Reply-To: <20191129215916.17105-1-enric.balletbo@collabora.com> From: Guenter Roeck Date: Fri, 29 Nov 2019 14:02:37 -0800 Message-ID: Subject: Re: [PATCH] power: supply: cros_usbpd: Remove dev_err() getting the number of ports To: Enric Balletbo i Serra Cc: linux-kernel , Collabora Kernel ML , Guenter Roeck , Benson Leung , Dmitry Torokhov , fparent@baylibre.com, Linux PM list , Sebastian Reichel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 29, 2019 at 1:59 PM Enric Balletbo i Serra 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 Reviewed-by: Guenter Roeck > --- > > 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 >