Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2098130ybt; Fri, 3 Jul 2020 00:20:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW7GSupvaarAXRiFWab0G1VftXFhKJfYf4bx5KUn74EEJmc+iNjXnLPlTgonf2IUeGoedC X-Received: by 2002:a05:6402:f:: with SMTP id d15mr16809253edu.25.1593760803075; Fri, 03 Jul 2020 00:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593760803; cv=none; d=google.com; s=arc-20160816; b=FxBSI6fycz1GSHkjq7P6ENY5HY52Ht55Y/DrY8DQTj5w1UgEQROqfgXvYfmrwcFL8k 1bx8Jnixga03gq0NXzXOft7h7B5yPNpGg2urX1UuS4ewz6BSIqOY0FWvcbG8m9hu4ZLc /zTB8usPHNO6H3tPlSlaRkIzaqG5DuX4PwYxQn67BpP3wAgAzPrmvwxRrEsaCtBxfLJ8 PdoPlpGxauQPX7SVJj0sOBLbHbiesEp3oiC3RZ8JwiO37mZJmKtKh40rgdrsEajvCCI+ WuyNAW9uwck5lSvtaiNiG/xcvLstSiqoxd0IRy8SbWm/J9kZg4FOr/d32wTbZ89WPYRo +qiQ== 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:dkim-signature; bh=JylBBIg6s0EqS8bdMWdfMXLZabsAcyVLV5Ia1GF24jE=; b=pHYUg/7c5hSYjXqaTG+2eVecqvVptdw9XWToIhnw3hIXQOgmP+cgepDz3RCSKM2MPa Z0N0N/L4l2wLDB0SeoGCtA5O56UbWwVFqcnAdlk/fr91bv0igx77SJxrAaFecufmzilw PugG3WNtYnKrjcjuU9FgS4toi6KbM8jH1t24F16A3VcJ9451lUBN+ldCPwX8WpGiKu5o FItQd3KVM6wtsw+83cSnLmZ5o3xdSb3shiIDiUmzzKy9zP3CzST/rhKueon2sj/V/U+O 06RBgiwbar9JBghA2UB+cdjfz6fPNaZQt6I9D0/pjv14ueBd2vIJuzpYN4eVdr1ZSFET cJxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LuBmQALB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si7302412eja.699.2020.07.03.00.19.40; Fri, 03 Jul 2020 00:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LuBmQALB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726098AbgGCHTV (ORCPT + 99 others); Fri, 3 Jul 2020 03:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgGCHTV (ORCPT ); Fri, 3 Jul 2020 03:19:21 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17909C08C5C1 for ; Fri, 3 Jul 2020 00:19:21 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id l6so10439187pjq.1 for ; Fri, 03 Jul 2020 00:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JylBBIg6s0EqS8bdMWdfMXLZabsAcyVLV5Ia1GF24jE=; b=LuBmQALByFHpbapAUDv6bqBgiD40v2S3cpXHTBd494VfOxmTeAfoOVxc3X7KJq6rYf mf3j3YomUb9B9FUv07321mneQR8s1v3xe+VZhtu4Ez8Gx6bEpl7muNosjsBi7YNyqExw PvJH23Kq03SPfX55KZjdgzDNJufwLz/TYl3Go= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JylBBIg6s0EqS8bdMWdfMXLZabsAcyVLV5Ia1GF24jE=; b=FI0CzYCMtk2Mk/44WG+dlV2xCkftLyIDaZxeo8PtLQQ3tnZ1E3PYf6w6cSffuhsk+n I8xTqckJR7paD3eyxKbe8UoZfUlRv0xx4MXn1LwBBAxaBCOve9LWNiIJSo2cGkwzk96B o/EXovnKHSNAOLVz3/VceWqKwLsaHbysSYsdboszHyGLELd1uIMWH2N3l6dwQ1agiK45 Wi+BNlJfi2sXdAehhHnIT9QsN8ywWvd3iFrC8tEu4ycP6TmVWNNmwqZGi9uG119s7Mo1 UgGx6DoSrwPsmkhf2FCewaZApSesmzSJJLONBq9ENDZsHdDywGHbxxecMoo5/bc8CQLl vibg== X-Gm-Message-State: AOAM531NP6QoiBdSojvWtQ7Ak+xrrfSf5voUkELlIQutTpFBqHMi953f KwGzBi0QApjMVIF1G0lZbhlC6NqpKxj4lw== X-Received: by 2002:a17:902:c391:: with SMTP id g17mr30067388plg.330.1593760760320; Fri, 03 Jul 2020 00:19:20 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:725a:fff:fe46:44eb]) by smtp.gmail.com with ESMTPSA id f3sm9603746pju.54.2020.07.03.00.19.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2020 00:19:18 -0700 (PDT) From: Yu-Hsuan Hsu To: linux-kernel@vger.kernel.org Cc: Tzung-Bi Shih , Cheng-Yi Chiang , Enric Balletbo i Serra , Guenter Roeck , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Benson Leung , alsa-devel@alsa-project.org, Yu-Hsuan Hsu Subject: [PATCH v2] ASoC: cros_ec_codec: Log results when EC commands fail Date: Fri, 3 Jul 2020 15:19:13 +0800 Message-Id: <20200703071913.2358882-1-yuhsuan@chromium.org> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog 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 Log results of failed EC commands to identify a problem more easily. Replace cros_ec_cmd_xfer_status with cros_ec_cmd_xfer because the result has already been checked in this function. The wrapper is not needed. Signed-off-by: Yu-Hsuan Hsu --- sound/soc/codecs/cros_ec_codec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c index 8d45c628e988e..a4ab62f59efa6 100644 --- a/sound/soc/codecs/cros_ec_codec.c +++ b/sound/soc/codecs/cros_ec_codec.c @@ -90,10 +90,17 @@ static int send_ec_host_command(struct cros_ec_device *ec_dev, uint32_t cmd, if (outsize) memcpy(msg->data, out, outsize); - ret = cros_ec_cmd_xfer_status(ec_dev, msg); + ret = cros_ec_cmd_xfer(ec_dev, msg); if (ret < 0) goto error; + if (msg->result != EC_RES_SUCCESS) { + dev_err(ec_dev->dev, "Command %d failed: %d\n", cmd, + msg->result); + ret = -EPROTO; + goto error; + } + if (insize) memcpy(in, msg->data, insize); -- 2.27.0.212.ge8ba1cc988-goog