Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8632532ybc; Fri, 29 Nov 2019 14:00:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyMcvlU7EFX66++4nT/Kh+VAdW6OqT9QkSesIZ0PI6mhhT23wQhCUSc0qnsUzpkoodNocnI X-Received: by 2002:adf:f2d0:: with SMTP id d16mr16162682wrp.314.1575064856030; Fri, 29 Nov 2019 14:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575064856; cv=none; d=google.com; s=arc-20160816; b=dTIh51lvNnj3iBx9B2mxM0ddUYZ8F694XyLRheBgp2XLDtIpooIL0UD1pFbPMMpYr2 ShvWWt0hA4/4g6tRFJEtHpPdFKTGrU+1qKp0A19o2jpx4A+KRd7gVNynJ2KR4Nav4qju lrTyJG/UDYTZ7tC237EDLesDYttY9toSBHRklOkjZirLVqwoUcP3EOfNVGGfCZ4I7DzR fBz2SQCTlR06fKZbrHzNohAVIxEFmpyOUkNpltRaewlKdTULlem9CCV42yq6aos162FG eX3YS5QoeLS7raZfguH6R6mhQRJJ0uQ+jjI1H78t4AHJLaAo44LKcwNfwbj/dVPcGgQA 8eSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=r932KVIvGXtSFAT7nuAycxGblLWuXWeIG+MCX0r9MjM=; b=VaT4Sy1rotWLiYazugiIWOYXyLAcZSYC9JR3qPZ8htE5YpFOPZICbXkn+MwrsCeyZz 9wBOemQAi8EUEJx8OK+i3i7h6mc3AlaO3MjqIHD5lmIdMj6eTumvv/kzdR9CYfsiF0A5 H1xqtH/tCHBqTyEE5J71SYEUApDkHWHKMlXz480ZNvZ71cpB0gtTjkm+gql9KOA/VRlP EEPEPDiAZQhH7TcDX89sEfcr2MIIBpoCpikVs6XkFZ4mweijMwScu6m+bSKUyj0U/oxw lUP8AJcKl1jx+LWHvZQ7D13JDDx64BQvYShnPj8elVhNB88ouMZmLYZZNo17rngPbCvH AhbA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pw17si15811117ejb.45.2019.11.29.14.00.31; Fri, 29 Nov 2019 14:00:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727196AbfK2V71 (ORCPT + 99 others); Fri, 29 Nov 2019 16:59:27 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41896 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbfK2V71 (ORCPT ); Fri, 29 Nov 2019 16:59:27 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id D9ABD28F55E From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Cc: Collabora Kernel ML , groeck@chromium.org, bleung@chromium.org, dtor@chromium.org, fparent@baylibre.com, linux-pm@vger.kernel.org, Sebastian Reichel Subject: [PATCH] power: supply: cros_usbpd: Remove dev_err() getting the number of ports Date: Fri, 29 Nov 2019 22:59:16 +0100 Message-Id: <20191129215916.17105-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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