From nobody Tue Jun 30 04:32:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D40E1C433F5 for ; Tue, 25 Jan 2022 10:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242356AbiAYKUC (ORCPT ); Tue, 25 Jan 2022 05:20:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239137AbiAYKPt (ORCPT ); Tue, 25 Jan 2022 05:15:49 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BB8AC0613EC for ; Tue, 25 Jan 2022 02:15:49 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id 4-20020a250304000000b006137f4a9920so39594713ybd.6 for ; Tue, 25 Jan 2022 02:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=doB02I4qSIR86llAlGQe+kwodmbCH1lEdNRlPOZ7RJM=; b=Q+ZIkfTltqz4qOuwoZbjAXVwZkFHvt0AQRjZ6h5mJ67D6lTbnrm+bPFcLOu8wShVK/ 4D71NwBWnNkevWqEtzjzuif2JuO/zovBD8IoOT9U7cx+hW04NWDPr272TLJp7a/5I4kv mQ8t4Ot9XGq0Cr5Vy8QDxydT7JVf2l6fTznlnMOGWEC2QPaiMn0Jut+ecgFgFjtzd3E6 blV+1TThV7ZqC1Ub2U8BiMfc4FGJreB+EZ9MI+70L2jtk6Vr1fYfnkaSgetGLZ0/n5dO FnV+E58JkIPQKE9xjGxeWCvpt+hLwkhliI/eqg3NUlVaOW+q7CLyYLGe5eb1Zn3dxaa0 Kp2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=doB02I4qSIR86llAlGQe+kwodmbCH1lEdNRlPOZ7RJM=; b=V3XNW1qL7VKyUR1We2M9Tl2whL2FN9EYQHeapNSS0DhrADjCvRq/JB3EEChsuGHa99 pcKaHwCxoSP9Eoh1L0r/I6Zn5LgejKIzU57cDeLYmDjBD1CJSFcQdsRjIBfMqL7Y8G+i i1Fytf6CIwZKIsLdmnsN+VtGuaHDqZsIjWEe8EaBlqW/9ucjO6mwal48U6ZV36TIM3eY OsnaiBDQs4W/oFIk75o8KOS5XALz8jKvAIsg0bInx1OCJRLRj4AZwMlVHAKyaUJN6j/T qB5yWVRIZL/tpURKKeGHS5Q3RhewvksaIcuwqJcJp3jVNNVdvUJXmn1Ogc/nT5F4u6OT 0Neg== X-Gm-Message-State: AOAM530iCzruZ+GhtM5EtfLTVGWd30kK6IzL95EDNid/6m2YdVGexh4I XB0xUfWnr/b9URTGx1Trsk//8Beo53iS X-Google-Smtp-Source: ABdhPJyOhFP5FqSpeywDFHUbBXaMD2WR8iKvWmZKfzHPZowdZTykVxzzx6348bJ1lA6I9ZspUFBLUPDDOJ+n X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:69af:7f25:2010:2c85]) (user=tzungbi job=sendgmr) by 2002:a81:a105:0:b0:2ca:287c:6cff with SMTP id 00721157ae682-2ca287c6f46mr6115897b3.420.1643105747887; Tue, 25 Jan 2022 02:15:47 -0800 (PST) Date: Tue, 25 Jan 2022 18:15:22 +0800 In-Reply-To: <20220125101527.1812887-1-tzungbi@google.com> Message-Id: <20220125101527.1812887-2-tzungbi@google.com> Mime-Version: 1.0 References: <20220125101527.1812887-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH 1/6] platform/chrome: cros_ec: fix error handling in cros_ec_register() From: Tzung-Bi Shih To: bleung@chromium.org Cc: groeck@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fixes cros_ec_register() doesn't unregister platform devices if blocking_notifier_chain_register() fails. Also uses the single exit path to handle the platform device unregistration. This fix depends on the fact that all the callers of cros_ec_register() allocate zeroed memory. Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version i= f EC transitions between RO/RW") Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/cros_ec.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index fc5aa1525d13..3aec890edd39 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -245,18 +245,16 @@ int cros_ec_register(struct cros_ec_device *ec_dev) if (IS_ERR(ec_dev->pd)) { dev_err(ec_dev->dev, "Failed to create CrOS PD platform device\n"); - platform_device_unregister(ec_dev->ec); - return PTR_ERR(ec_dev->pd); + err =3D PTR_ERR(ec_dev->pd); + goto exit; } } =20 if (IS_ENABLED(CONFIG_OF) && dev->of_node) { err =3D devm_of_platform_populate(dev); if (err) { - platform_device_unregister(ec_dev->pd); - platform_device_unregister(ec_dev->ec); dev_err(dev, "Failed to register sub-devices\n"); - return err; + goto exit; } } =20 @@ -278,7 +276,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) err =3D blocking_notifier_chain_register(&ec_dev->event_notifier, &ec_dev->notifier_ready); if (err) - return err; + goto exit; } =20 dev_info(dev, "Chrome EC device registered\n"); @@ -291,6 +289,12 @@ int cros_ec_register(struct cros_ec_device *ec_dev) cros_ec_irq_thread(0, ec_dev); =20 return 0; +exit: + if (ec_dev->pd && !IS_ERR(ec_dev->pd)) + platform_device_unregister(ec_dev->pd); + if (ec_dev->ec && !IS_ERR(ec_dev->ec)) + platform_device_unregister(ec_dev->ec); + return err; } EXPORT_SYMBOL(cros_ec_register); =20 --=20 2.35.0.rc0.227.g00780c9af4-goog From nobody Tue Jun 30 04:32:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62370C433EF for ; Tue, 25 Jan 2022 10:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243262AbiAYKU0 (ORCPT ); Tue, 25 Jan 2022 05:20:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241215AbiAYKPz (ORCPT ); Tue, 25 Jan 2022 05:15:55 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D320C0613F0 for ; Tue, 25 Jan 2022 02:15:55 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id n2-20020a255902000000b0060f9d75eafeso40633980ybb.1 for ; Tue, 25 Jan 2022 02:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=DaKuIzTI79zUYcyKsPYW3TP3Y5c4qM860aXt8MCFVpA=; b=B1z9pW3hP5IkrS9SKJlmIhOiXdn+Sn3m9MTLWw3FMTjoYB4ROZksTJVEhqTJjxurGz Ts53c+Xivbcwykk2ZX5Pfm3Y5dya2YEQ8WSs/Uo7d9UOXd92cXdyo5GAR+itUP7j9OIj vekEXD5+XSiPOOxIDPIo5lmQEwtfwxnr97qd7dAAPLoNzEAoAwbUhn+EL+5WqyTgn+SO dWlswKO+Gm93VP368y+DFmsOVThKIbrGmHQf9rKbCUOzmM1E797gLwj3Nul+rpDSVaRi Bdf3eHohE6J9O92e+YU3CgLILCuxGmpUiIaC83z2q7m8ftIctrt3dIOABISOZp2yl9B/ NSAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=DaKuIzTI79zUYcyKsPYW3TP3Y5c4qM860aXt8MCFVpA=; b=x89mrv0I22T7fV7nbHKuvV6bWSfJZHnqwdsYQd4wBZBJRVeZX2ONFt6mJA2yI1sSwE sVoMd5TLvE0LPsE3h8lAk1Gsvu0v5HyC3ss93LIllpMfNzIdpFJD4ZKipLSdIG+4kwP9 pFYoO/EzXhb3Cxuzqsv0wFGHo842YUexaUWVMx8Dt1UBFfeE+7grB7m88L13FF3wNRNV YOlJegNY62l3Vm4Yqzcbzer5i/b+3csc10yeYeVrLEnA+udYSj5Wv6UzTfmGp3WNQOtQ 4/SDztnLnBlByXeYUBVBvGM7i7Cbug1+EnrKBoiqx5N2u3zJdfuXj/WuL9LpF/QibBU0 zqDg== X-Gm-Message-State: AOAM533cUrydjYZ8U921APoOJtrxOSbkMiS8U8RDIXx9FfW1x653zv7O Wf5gp4t+RvTIjoKtk/p0I7SHB3M+7dLC X-Google-Smtp-Source: ABdhPJx9VPCW9B9P6v/6chD1IlB38QClG4/aZWYqKBbntTx7hwJRbYpkOBIBsPa3DDFUJNhoTCVNz6AQYZNl X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:69af:7f25:2010:2c85]) (user=tzungbi job=sendgmr) by 2002:a25:cb96:: with SMTP id b144mr1872368ybg.338.1643105754411; Tue, 25 Jan 2022 02:15:54 -0800 (PST) Date: Tue, 25 Jan 2022 18:15:23 +0800 In-Reply-To: <20220125101527.1812887-1-tzungbi@google.com> Message-Id: <20220125101527.1812887-3-tzungbi@google.com> Mime-Version: 1.0 References: <20220125101527.1812887-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH 2/6] platform/chrome: cros_ec: remove unused variable `was_wake_device` From: Tzung-Bi Shih To: bleung@chromium.org Cc: groeck@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" `was_wake_device` is unused. Removes it. Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/cros_ec.c | 1 - include/linux/platform_data/cros_ec_proto.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index 3aec890edd39..a37448f3e179 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -344,7 +344,6 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev) ec_dev->wake_enabled =3D !enable_irq_wake(ec_dev->irq); =20 disable_irq(ec_dev->irq); - ec_dev->was_wake_device =3D ec_dev->wake_enabled; ec_dev->suspended =3D true; =20 return 0; diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/pl= atform_data/cros_ec_proto.h index df3c78c92ca2..c65971ec90ea 100644 --- a/include/linux/platform_data/cros_ec_proto.h +++ b/include/linux/platform_data/cros_ec_proto.h @@ -76,8 +76,6 @@ struct cros_ec_command { * struct cros_ec_device - Information about a ChromeOS EC device. * @phys_name: Name of physical comms layer (e.g. 'i2c-4'). * @dev: Device pointer for physical comms device - * @was_wake_device: True if this device was set to wake the system from - * sleep at the last suspend. * @cros_class: The class structure for this device. * @cmd_readmem: Direct read of the EC memory-mapped region, if supported. * @offset: Is within EC_LPC_ADDR_MEMMAP region. @@ -137,7 +135,6 @@ struct cros_ec_device { /* These are used by other drivers that want to talk to the EC */ const char *phys_name; struct device *dev; - bool was_wake_device; struct class *cros_class; int (*cmd_readmem)(struct cros_ec_device *ec, unsigned int offset, unsigned int bytes, void *dest); --=20 2.35.0.rc0.227.g00780c9af4-goog From nobody Tue Jun 30 04:32:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90377C433F5 for ; Tue, 25 Jan 2022 10:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243404AbiAYKU3 (ORCPT ); Tue, 25 Jan 2022 05:20:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243260AbiAYKQB (ORCPT ); Tue, 25 Jan 2022 05:16:01 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97685C061401 for ; Tue, 25 Jan 2022 02:16:00 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id n2-20020a255902000000b0060f9d75eafeso40634321ybb.1 for ; Tue, 25 Jan 2022 02:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=RGrFnh9zh++a9BFh/Jb2qGqRL46uda17I0gKh7myi08=; b=TsQtEztz6vq21oNr0OUxFPxnzt5F+kOhGsC+mOg8FUbuVu5e/hJcCZ6yGEdV74ebuJ fp6LloOSuhIxDgVHJ3zsLME58BsbHhERfI2BDbms8PEZAonZcoc5wIAvgfZ+eNouyBMH 3HhcuvcifcWJ+gm/0of+r635IyeGkTVsE+UFOo+s1L3ZJfT+17BvQt1F7bZ1L+C2YhTn hnWlffC0AFbXOHd45LHMJWXBOEYsw4uqWFWMuZhT7IIwpGb2X84uU4QfFH5ZSbfTgefn CsTTLuodpYpq/YmB2UUCYf83Y/D7h2/Pf0Y2UBQaId1t+a1Q168H8ERVMWAUVJm9A88u ZaRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=RGrFnh9zh++a9BFh/Jb2qGqRL46uda17I0gKh7myi08=; b=4pvDOSH4qjg2IHn63uPS061Rj9CtyHUDSsSta+fslMi29PBdKbp7XR1ulNjYmtm2a8 s6sQNjTlB7dm0K4GHIilWZJTTY4CM9oYILoEs3JLrnc7jNaBmTdMpATiQ9+6MVyfZhtN H0UUysGr3FxWze6fwfc+XtJJsNS6xx2b+n55aRIpoZ21OgKq/0jLLQFZPggh0cRRERtT Iedf5831s0VJAnqdKuG4ctlnp/xzFlFqRb2Ic3x/JZY2NoExrX3LPiJMnSG6Bi4o8Jdm ruJtvt7+djvqRvw3pkd/tGOLWyqAmIk5GXxbWB6jqGngIXQuYgqQsdtrTZt1QFdIgdJW CPew== X-Gm-Message-State: AOAM532zyje+1ZRm0+YmLSP/iaWvoGlgnbz1fb0BBCgprT8DPubuMeAu zwpJ1yloBa14MMfkEcFXtKXyW6REaTpi X-Google-Smtp-Source: ABdhPJyNMr3PDYuABChRC1ug5r38sZa+F8+T+qC6ZbQ2T8ZOWBTaXQVlN+yFBCLFOf2VGk7lexIw7JKW7o3w X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:69af:7f25:2010:2c85]) (user=tzungbi job=sendgmr) by 2002:a5b:611:: with SMTP id d17mr28025716ybq.92.1643105759872; Tue, 25 Jan 2022 02:15:59 -0800 (PST) Date: Tue, 25 Jan 2022 18:15:24 +0800 In-Reply-To: <20220125101527.1812887-1-tzungbi@google.com> Message-Id: <20220125101527.1812887-4-tzungbi@google.com> Mime-Version: 1.0 References: <20220125101527.1812887-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH 3/6] platform/chrome: cros_ec: determine `wake_enabled` in cros_ec_suspend() From: Tzung-Bi Shih To: bleung@chromium.org Cc: groeck@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" `wake_enabled` indicates cros_ec_resume() needs to call disable_irq_wake() to undo enable_irq_wake() in cros_ec_suspend(). Determines `wake_enabled` in cros_ec_suspend() instead of reset-after-used in cros_ec_resume(). Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/cros_ec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index a37448f3e179..abbe71309e40 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -342,6 +342,8 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev) =20 if (device_may_wakeup(dev)) ec_dev->wake_enabled =3D !enable_irq_wake(ec_dev->irq); + else + ec_dev->wake_enabled =3D false; =20 disable_irq(ec_dev->irq); ec_dev->suspended =3D true; @@ -383,10 +385,9 @@ int cros_ec_resume(struct cros_ec_device *ec_dev) dev_dbg(ec_dev->dev, "Error %d sending resume event to ec", ret); =20 - if (ec_dev->wake_enabled) { + if (ec_dev->wake_enabled) disable_irq_wake(ec_dev->irq); - ec_dev->wake_enabled =3D 0; - } + /* * Let the mfd devices know about events that occur during * suspend. This way the clients know what to do with them. --=20 2.35.0.rc0.227.g00780c9af4-goog From nobody Tue Jun 30 04:32:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E70C8C4332F for ; Tue, 25 Jan 2022 10:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344623AbiAYKUw (ORCPT ); Tue, 25 Jan 2022 05:20:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243271AbiAYKQG (ORCPT ); Tue, 25 Jan 2022 05:16:06 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84528C061782 for ; Tue, 25 Jan 2022 02:16:06 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id v70-20020a25c549000000b006130de5790aso40613235ybe.4 for ; Tue, 25 Jan 2022 02:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=lP/ZW2jfCoZSTJKpFAgOH7cQzMhxGPU0UuCQt1ZX2xg=; b=G6BjtBL2PQpKPzs/aslF4eV9StQg1wCafTxVudubwVNxLRrHUmHPP4wDH5xx21Lv4f qpEEbm8/Z+eR+/z2yndoa+iZ0Pn11Pi5aaa05k2ihLKMil9jJo3fcl721rFm8eR48E8o 6BlHCvfb5t+8AGYpFCzDR0LH0DMEx+4xFtt0VA8fETU/Hi0E+7l3hm71aRHz/wSa9XC6 fobrYBmzGPTdoE1T+F5Yd/pa+AQraStZgcyxSi4u3fbWOJRYEsTblWKP/hFVGdZ5d/e3 qPBc3vZS5NL4gJwqFGH6fWCU9hMtt0vNgdcKtUU6xIkpAt31RqmalNQP+6ZWneht3ylC d9/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=lP/ZW2jfCoZSTJKpFAgOH7cQzMhxGPU0UuCQt1ZX2xg=; b=3OSIeRjmSAVL9nBQ1FQTN/XUytZfZMYqtyXGXdfMbwGYYJBlGCKyxhRUtxlm9TeM3U uaEgmJalQUv9XxVDx96KrGWMC2tqs2r6Oj3Ig+KIUc6ZayNKwj38y8dFEHI0Mly7dkNz an+eblTJAZSBd+ZYZNXZvgxnu+4aELrfg9QKMz8fO8EX0hCsuqCrDEp6JayA8VDF0J96 pjR3yg1dTa6iREWawhsI87KuVwiDcNA3ZrCq5OUPmqp8egFjW0QJA0R5wKV1iKzLqY/t cYBBe9khBdWbOhHvEb+Uz00uNWEfxtB//WJFkAlYlxUyr2fY4VWf3AfYTuXi9P2DuIrf h+og== X-Gm-Message-State: AOAM532dQnWTvWBn1TgHH2ujRslrHf5mnY+tapyhDTGbXni3FZ5FKp6F mjltuWFEQvlOCJkrrNB78XhTnjtlIUjl X-Google-Smtp-Source: ABdhPJyunl1cw7ZQwlY/k4N0AAgqmv4udxGgJmmTXjkcLOpwjvvj+WTae4O2E+OJNsZ3pI+myw/RrVEkN4Al X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:69af:7f25:2010:2c85]) (user=tzungbi job=sendgmr) by 2002:a81:8505:0:b0:2ca:287c:6be0 with SMTP id 00721157ae682-2ca287c6e2fmr6127727b3.133.1643105765494; Tue, 25 Jan 2022 02:16:05 -0800 (PST) Date: Tue, 25 Jan 2022 18:15:25 +0800 In-Reply-To: <20220125101527.1812887-1-tzungbi@google.com> Message-Id: <20220125101527.1812887-5-tzungbi@google.com> Mime-Version: 1.0 References: <20220125101527.1812887-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH 4/6] platform/chrome: cros_ec: don't initialize `err` in cros_ec_register() From: Tzung-Bi Shih To: bleung@chromium.org Cc: groeck@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" `err` in cros_ec_register() doesn't need to be initialized. Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/cros_ec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index abbe71309e40..c2c7a748e48f 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -182,7 +182,7 @@ static int cros_ec_ready_event(struct notifier_block *n= b, int cros_ec_register(struct cros_ec_device *ec_dev) { struct device *dev =3D ec_dev->dev; - int err =3D 0; + int err; =20 BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier); =20 --=20 2.35.0.rc0.227.g00780c9af4-goog From nobody Tue Jun 30 04:32:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E978C433EF for ; Tue, 25 Jan 2022 10:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345581AbiAYKVS (ORCPT ); Tue, 25 Jan 2022 05:21:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243278AbiAYKQM (ORCPT ); Tue, 25 Jan 2022 05:16:12 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C13FC061786 for ; Tue, 25 Jan 2022 02:16:12 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id e130-20020a255088000000b006126feb051eso40617506ybb.18 for ; Tue, 25 Jan 2022 02:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=aI21/4gV7GE78BNvrrZ+I/runsfBL/IYqx2eo04++Yg=; b=KB7Nun3RrziiFsC6bhOEwRZe9FK8Zz9A9CN5rOClV7t3nf+hc4lZsYVdXt7rRA3NDs ILUG4f9LEqOxTDVy6SRXrvKX8614c9lTX4zPO0dq9O4aRw5RDSsAS2m0D3uTiiOFLMHV F2a85E+vo1CmaUF6Gp83CTgq9t8NNyyrGZfalJoCDkgA86+XnaEBitt6BwzoPVVVFpSK dJ619OOeiGr8RqH8YL+afoKCNw3sHkv/zNZdN3bn0vWEQDdjKSWJBicALSdCSO9AqMZ3 1otX2jiePEajjqb2MmIM19OFQ/G+iVKedsJ4rOo2vBoqm+AIhKHgrm/HCsT6QJX143MW AHjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=aI21/4gV7GE78BNvrrZ+I/runsfBL/IYqx2eo04++Yg=; b=DK1IM+JCzAoBjuFamjm4H3lyej6Plr0rQWegjLz5rNI9TK4BznlkCHROXFWDmOu39H xTJHUTz1mOAh03khA8z+vIuYqPZPxVwlJQkyuTq/NuHPByezkd2s9RilCTBbzpE6jsvB aDQQUVEVV8bMRygt/IrAfFror/LhMHJ6HlC4jKkMNuYVV8HoE+ZnomEjxUBpCXas8cjb hlWKrzL0u0hakkJ8mMD7Kjl/IeR7kp8hUW4ZYQLeECu5/iEQuFaBd2w8x+8yxM7LsNmM 20ryt3GQvYXyunk/Ag62Tepc4JrWD2uQ2o/KyUkayZCAFzf3mhqCXepVmbV9aj//YFDm DKmA== X-Gm-Message-State: AOAM533FVhdPuUU+SwB9pdzqLENoHp0SDRSUdeZcNyh1EDqufx0afxYq dZYfIebAQLd+CN5UMnOVJqnJRSntILR3 X-Google-Smtp-Source: ABdhPJzDBPGHBST943mTHqe9TTEk25fUz6fXiUzvGnsyP2G0HUwkWvJs5jpEIhVscISHLTiow0YfHNpRmJWM X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:69af:7f25:2010:2c85]) (user=tzungbi job=sendgmr) by 2002:a81:d8b:0:b0:2ca:287c:6bb3 with SMTP id 00721157ae682-2ca287c6e04mr5759177b3.88.1643105771441; Tue, 25 Jan 2022 02:16:11 -0800 (PST) Date: Tue, 25 Jan 2022 18:15:26 +0800 In-Reply-To: <20220125101527.1812887-1-tzungbi@google.com> Message-Id: <20220125101527.1812887-6-tzungbi@google.com> Mime-Version: 1.0 References: <20220125101527.1812887-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH 5/6] platform/chrome: cros_ec: sort header inclusion alphabetically From: Tzung-Bi Shih To: bleung@chromium.org Cc: groeck@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Sorts header inclusion alphabetically. Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/cros_ec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index c2c7a748e48f..934ab30c9d08 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -9,12 +9,12 @@ * battery charging and regulator control, firmware update. */ =20 -#include #include -#include #include +#include #include #include +#include #include =20 #include "cros_ec.h" --=20 2.35.0.rc0.227.g00780c9af4-goog From nobody Tue Jun 30 04:32:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D68FC433FE for ; Tue, 25 Jan 2022 10:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346500AbiAYKVc (ORCPT ); Tue, 25 Jan 2022 05:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243295AbiAYKQU (ORCPT ); Tue, 25 Jan 2022 05:16:20 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E07E1C061787 for ; Tue, 25 Jan 2022 02:16:17 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id a3-20020a056902056300b0061496fc6a45so25465246ybt.14 for ; Tue, 25 Jan 2022 02:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=x2MdSdGv5+J9gN355PMaPNhrV9fxjS31nvsNBZsbXJQ=; b=Qd1J/nzdXCvpZXg4Ebtb2NAj9AiXOkPXKNlMoRUksh23IVkQtwcbo/g+gBp8sL2mI/ wB0fdgQYZT1r2oENBwCRqNmua4MWvgYkWYYYk/1tlMpoT/IafHw0LLe/E196cG2xAPd1 iiZM5Fc4s3bPpYDTGLw/6xUCRBk/9/4B491qCxK+GMzuov6baBkem/Zt7tt7dn0p+Ylr c5E7yNcBtCpdrA/s4Mp+rBWHUgWKnhFqiXIU15c/T4pPjBcucq38+JCNO4fpPmAMQ6p7 X8wklLVpirP9mvJkdiQAL/41Wf9BP/rS16b/4eSAQJMDceS7/JQfrBGeEL97qTIn2R/j /iUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=x2MdSdGv5+J9gN355PMaPNhrV9fxjS31nvsNBZsbXJQ=; b=Kw+htHJVzwCccyiXjH0meuItcwt1tH6Mf8qk1fWD0qQB57W3FmjM0AAAMufhHk/TyW CMLeJ/myPZLdCyfGlsyk0HZ9LU3txF565RUCXKdCaLEk1RLW7WlDDL9OcQhkzBbc7QXR IwYBZxthbeYCu8QIiJPphFGT0nUwSV/7dWlcZYTBdOBq48VHe6Cb1QK4FiDd48JHEir4 mm+siWQPHBA8qtT/ahbiUloaLU46xa7ulymEIKa+SPfE/t02B2gvl22pZfP/2ePKk8Me 6JEKdZViY5ZguxmqHLuGFVhbBDGDSintFWW6Pm4FnPWNtiJSJVzVDpL+T4Afw6znWfej AhiA== X-Gm-Message-State: AOAM530byw977Z1/s/FfHhBLJeGNolvtqvaluX9nUzwN9kDtaJtL9t4Q BFkgv/yLUghLDCUx6vwvgxzanXkI7oxq X-Google-Smtp-Source: ABdhPJyATR5uZn9dMeDP8WCoFnEs9KhBUGqkfTI6wA4cdQPp6P0oNpVhO+YHNNhosXwm8J8AHtnJCg2Db1TW X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:69af:7f25:2010:2c85]) (user=tzungbi job=sendgmr) by 2002:a25:af4b:: with SMTP id c11mr28212004ybj.49.1643105777186; Tue, 25 Jan 2022 02:16:17 -0800 (PST) Date: Tue, 25 Jan 2022 18:15:27 +0800 In-Reply-To: <20220125101527.1812887-1-tzungbi@google.com> Message-Id: <20220125101527.1812887-7-tzungbi@google.com> Mime-Version: 1.0 References: <20220125101527.1812887-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH 6/6] platform/chrome: cros_ec: append newline to all logs From: Tzung-Bi Shih To: bleung@chromium.org Cc: groeck@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To be consistent, appends newline ("\n") to all logs. Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/cros_ec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index 934ab30c9d08..679df6af5612 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -213,7 +213,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) IRQF_TRIGGER_LOW | IRQF_ONESHOT, "chromeos-ec", ec_dev); if (err) { - dev_err(dev, "Failed to request IRQ %d: %d", + dev_err(dev, "Failed to request IRQ %d: %d\n", ec_dev->irq, err); return err; } @@ -264,7 +264,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) */ err =3D cros_ec_sleep_event(ec_dev, 0); if (err < 0) - dev_dbg(ec_dev->dev, "Error %d clearing sleep event to ec", + dev_dbg(ec_dev->dev, "Error %d clearing sleep event to ec\n", err); =20 if (ec_dev->mkbp_event_supported) { @@ -337,7 +337,7 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev) =20 ret =3D cros_ec_sleep_event(ec_dev, sleep_event); if (ret < 0) - dev_dbg(ec_dev->dev, "Error %d sending suspend event to ec", + dev_dbg(ec_dev->dev, "Error %d sending suspend event to ec\n", ret); =20 if (device_may_wakeup(dev)) @@ -382,7 +382,7 @@ int cros_ec_resume(struct cros_ec_device *ec_dev) =20 ret =3D cros_ec_sleep_event(ec_dev, sleep_event); if (ret < 0) - dev_dbg(ec_dev->dev, "Error %d sending resume event to ec", + dev_dbg(ec_dev->dev, "Error %d sending resume event to ec\n", ret); =20 if (ec_dev->wake_enabled) --=20 2.35.0.rc0.227.g00780c9af4-goog