From nobody Sun Jun 28 02:50:43 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 12725C433EF for ; Wed, 16 Feb 2022 04:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344400AbiBPEhJ (ORCPT ); Tue, 15 Feb 2022 23:37:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344376AbiBPEhG (ORCPT ); Tue, 15 Feb 2022 23:37:06 -0500 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65478ECC4C for ; Tue, 15 Feb 2022 20:36:55 -0800 (PST) Received: by mail-pj1-x1049.google.com with SMTP id ay10-20020a17090b030a00b001b8a4029ba0so3862656pjb.5 for ; Tue, 15 Feb 2022 20:36: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=L2Rv1HN3aOgdNDlKvNWeNesh39hy8goLHfRj+y0FOyo=; b=RyOJ8/c/bdvV3j2m1WsUTqbrWRYq+AVhJSMj4Kvyi1gL1WX4Q5fOqhLHqxp6dLwNJ7 12B//cGyKUk2u6j1O/zjOu+Bx2U/cDqEGHoEaMLMjlq5tVzl+OibSHg2LsUy3B/aBl4P 6fk+a62qWrYADmfTm0Ea5a1wFNU8GTIrOxGp5xJm3m0SBNmDHJTARr+NBVOiuBmLkD2u Z49xhDdP/yiOaoKQ7h2DuoqaEGVS8M8D+14Ya0jI43fU+UoEt5guJNReIlmmImpBW2gu HMZz8MM+OpbLpl1v9gMThr68sI/GgMmP3BUM+9if+5B8Ocg4fvhd545U4ZBb0Edfkj/L Jgpw== 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=L2Rv1HN3aOgdNDlKvNWeNesh39hy8goLHfRj+y0FOyo=; b=tm8NhKNFuBWOTg0g1EmUc+QkEA3mgWIeXWpRoryYgGGk8MHoDiikKDXGf0YKV9Rket idwE6lkQfEdkIS5pVjzD8A6xyjsB6nYSzwbSaBroqGkjwhIU+VCqK+oItEzakw8JoHnG xOcZ41Miwekntf3AvOTajraVQQ3fy0DkBfAQ/dVEHUzR10095ClYk0V8A9J5xZgZFAA9 q3sGSgV/q19UmvaEoEhqLKTorr9jX1nzHesVir9zig8JSXmMxpllRmBxzrbAAS3+huuN UApN9A5GvMZ8cCY5B8OmfWHSFXGj8j7Cq4jEXaSWKDS4AbfINSCwn3TgJp/mwgO7xcLP AjaQ== X-Gm-Message-State: AOAM530p+dcgfP1HWMvdKOse/L96jH1250dME0x/DqWVe1DEh+SfRkAt IoTn7zZhzdk/Q5+yiHhH6jb/NvsnckLC X-Google-Smtp-Source: ABdhPJxjaNkNFssd+42CZAQI78GS0fwSyxgzKNfs+CeFwS+D9dBy8OghmG9/u2ygTNyjyJokWgiLhEYqIHHc X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a17:902:c651:b0:14d:bd13:6ff5 with SMTP id s17-20020a170902c65100b0014dbd136ff5mr671657pls.170.1644986214845; Tue, 15 Feb 2022 20:36:54 -0800 (PST) Date: Wed, 16 Feb 2022 12:36:35 +0800 In-Reply-To: <20220216043639.3839185-1-tzungbi@google.com> Message-Id: <20220216043639.3839185-2-tzungbi@google.com> Mime-Version: 1.0 References: <20220216043639.3839185-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v4 1/5] platform/chrome: cros_ec: fix error handling in cros_ec_register() From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@google.com, pmalani@chromium.org, 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" Fix cros_ec_register() to unregister platform devices if blocking_notifier_chain_register() fails. Also use the single exit path to handle the platform device unregistration. Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version i= f EC transitions between RO/RW") Signed-off-by: Tzung-Bi Shih Reviewed-by: Prashant Malani --- Changes from v3: (https://patchwork.kernel.org/project/chrome-platform/patch/20220209095703.= 517608-2-tzungbi@google.com/) - Simplify by initializing the variables at the beginning. Changes from v2: (https://patchwork.kernel.org/project/chrome-platform/patch/20220209045035.= 380615-2-tzungbi@google.com/) - Fix grammar error in commit message. - Change the code that don't rely on zeroed memory. - Remove unnecessary `if` checks before calling platform_device_unregister(= ). Changes from v1: (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T= /#u) - Use imperative mood in commit message. - Use IS_ERR_OR_NULL() in 1st patch. 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..ff2a24b0c611 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -189,6 +189,8 @@ int cros_ec_register(struct cros_ec_device *ec_dev) ec_dev->max_request =3D sizeof(struct ec_params_hello); ec_dev->max_response =3D sizeof(struct ec_response_get_protocol_info); ec_dev->max_passthru =3D 0; + ec_dev->ec =3D NULL; + ec_dev->pd =3D NULL; =20 ec_dev->din =3D devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL); if (!ec_dev->din) @@ -245,18 +247,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 +278,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 +291,10 @@ int cros_ec_register(struct cros_ec_device *ec_dev) cros_ec_irq_thread(0, ec_dev); =20 return 0; +exit: + platform_device_unregister(ec_dev->ec); + platform_device_unregister(ec_dev->pd); + return err; } EXPORT_SYMBOL(cros_ec_register); =20 --=20 2.35.1.265.g69c8d7142f-goog From nobody Sun Jun 28 02:50:43 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 6EDF6C433EF for ; Wed, 16 Feb 2022 04:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344410AbiBPEhN (ORCPT ); Tue, 15 Feb 2022 23:37:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344376AbiBPEhL (ORCPT ); Tue, 15 Feb 2022 23:37:11 -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 0EAE2EFF99 for ; Tue, 15 Feb 2022 20:37:00 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id x1-20020a25a001000000b0061c64ee0196so1873816ybh.9 for ; Tue, 15 Feb 2022 20:37: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=3psUtytUo6C/8Z0JrCprvFcq0BsJKPsjqLf/EYmVQiY=; b=R61yA4MuvnJnZisJJDkQCcKXaqxVdWCN7piOxfw0ApsloLfargZcrWV2ECFhBjxk5L FW/60zSo83AP+wRNDJX2qCoAJtiG8S9DheCMRJfV5gmAT9KJjstOQsoq4ZLCQdtJkEW3 v6Y9Qutmhj1MnWkFdlZiyRPVD/QitEae4P5kqAT5+1ornj2CGcEaN0vPO6Vd80EjsGXC w/Vo2xHAV3FVNI8no0ogSAdiYl+38s3jflv7tasY9iVoyk4g2ztRcHV8pVS/QxnIu5Ky ceJBeKzQ0joXBKCkmrBZ+MZWJFGsvF1iOVWjhfFqFOZPK/SrIkKehcHel5rjRu4FcQap f4YA== 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=3psUtytUo6C/8Z0JrCprvFcq0BsJKPsjqLf/EYmVQiY=; b=rKOheypZZWqQES01r2f1zBlGUVpRh8R9GC6NGIV3I1PoFJKvZvd2xJM7BCxexc+dcL cBhcLA2JNc9uEFmruZf0nVlPrN92aUWAUURNgx/mxhw8rpifOd8x0gNAzr5htMicCS5Q wmord15L+lX70hCJuvl/AWjA0FECVePTSo0haOeKrWN5KmL5ceYB4/l2sZ7lChQcT+5Q plhwhj4X2NTcp7kWqppOA0KhnKyxptjj5iF+2wfqlb3dYLa0j2UCTEbLuIB6Ozq2t2IV agBGISM+HZDbjPtL47rPX3PvZm3DsfPmlCc1VfkM0a0/QmTTKXIu9MtIwXBOTjacmZZA KLnQ== X-Gm-Message-State: AOAM532wgCQhjrc+BW7QkOacd9pL+HhOlW6tspsHr0ABCkxvLhJcm5Do oRYtRLI0FWvLNBFEl9ZyMAerIoPVEfbI X-Google-Smtp-Source: ABdhPJyXmG4jjevHJQteNz+ljtX+93eYeDh1wIh5I4xce+CKQryCSEl6xChYGFlGey+mXlpDLbDktU12iaDR X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a05:6902:110b:b0:61b:3576:95d1 with SMTP id o11-20020a056902110b00b0061b357695d1mr692277ybu.694.1644986219311; Tue, 15 Feb 2022 20:36:59 -0800 (PST) Date: Wed, 16 Feb 2022 12:36:36 +0800 In-Reply-To: <20220216043639.3839185-1-tzungbi@google.com> Message-Id: <20220216043639.3839185-3-tzungbi@google.com> Mime-Version: 1.0 References: <20220216043639.3839185-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v4 2/5] platform/chrome: cros_ec: remove unused variable `was_wake_device` From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@google.com, pmalani@chromium.org, 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" Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih --- No changes from v3. Changes from v2: (https://patchwork.kernel.org/project/chrome-platform/patch/20220209045035.= 380615-3-tzungbi@google.com/) - Add pmalani's R-b tag. - Remove redundant commit message. Changes from v1: (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T= /#u) - Use imperative mood in commit message. 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 ff2a24b0c611..25cd8df6e7b0 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.1.265.g69c8d7142f-goog From nobody Sun Jun 28 02:50:43 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 3EACDC433F5 for ; Wed, 16 Feb 2022 04:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344418AbiBPEhX (ORCPT ); Tue, 15 Feb 2022 23:37:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344406AbiBPEhP (ORCPT ); Tue, 15 Feb 2022 23:37:15 -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 721DEF1EBB for ; Tue, 15 Feb 2022 20:37:04 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id h6-20020a253a06000000b0061de83305f2so1802853yba.19 for ; Tue, 15 Feb 2022 20:37:03 -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=bYXXjRPc3+amq4nUn2zKlGGGB3ySddzbVS7PLxHhbGI=; b=AnyhfMfehc17BivQ/iPlxJOqaloiNeAlCKUVWzYDr2j6PopYBv8Ng6e396M+41Lo5/ ILN70TE/GTQs8eFLLcavMUNDqUGxPrHfzJ7YhTtbNYkMJ2eUH0Ae7YmulGlJXed4VqyF NVb5MISdL6pKgQvJlo81UCNr+3s3SYhuVpy/fMyq03OJp4kWieR/Kmh81YxFDIBi0UlN Hxcr2DDYcw4mbQia8Zofh0E1kzQmGU000vSekQM2eWUqdQX8oA1fHt4l32Gsv7yNduzr HkBmRDzMTk4XP1Qe/QaDdnDlYyQuWKhyTtMugsLmbAkXF9QgnvEtuAL+4uXLl89ZF3n3 3cDA== 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=bYXXjRPc3+amq4nUn2zKlGGGB3ySddzbVS7PLxHhbGI=; b=qPxVFeXNOSF8uu3maDpa/0GYlQWLASdYMCJrES1J2jhgJGa1X+QwbOIjouPp3xXZUM Kvkm+AkmYOMoljj+IkZKw7O2yZsOs4esAQ4o2PeYNi93LK4U+XVhdcz/f01AGis/FH7Y ccVRm0CHHdTReruPtkA1Wq8I9xaRoAzEn6VGHqPyXpEO06KX0btlUNguvbk93ruWh663 EXWdoAtga904uj5Y2WMowA0gWQBfKsxgdNUhfpRolvKe02snp///dCb5IfzV5+lAo7JN 9beCpIofWePGFIjkGWPNG7nENPHcIjFhMvW1lR6/6Bj9yHCtO7ueCze3Qf3iDZX5pKAL kCPQ== X-Gm-Message-State: AOAM533DvZMp9gInBWh7qhbzm2qJjwUV452dPvtZdqsiS+w31Jya/Jbj 3G+cdG9hqZAG4jRjBPbp5dURV4OvGE/B X-Google-Smtp-Source: ABdhPJw95YErySPO3wArh7ukWmaemcssepqzKqsZZ6nlYXHHAxFhSFXHWC8WbsD9bG5pE/NAuv1pbQV0/6MJ X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a25:dfd0:0:b0:61e:1ddf:a07e with SMTP id w199-20020a25dfd0000000b0061e1ddfa07emr756178ybg.242.1644986223292; Tue, 15 Feb 2022 20:37:03 -0800 (PST) Date: Wed, 16 Feb 2022 12:36:37 +0800 In-Reply-To: <20220216043639.3839185-1-tzungbi@google.com> Message-Id: <20220216043639.3839185-4-tzungbi@google.com> Mime-Version: 1.0 References: <20220216043639.3839185-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v4 3/5] platform/chrome: cros_ec: initialize `wake_enabled` in cros_ec_register() From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@google.com, pmalani@chromium.org, 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(). Initialize `wake_enabled` in cros_ec_register() and determine the flag in cros_ec_suspend() instead of reset-after-used in cros_ec_resume(). Signed-off-by: Tzung-Bi Shih --- Changes from v3: (https://patchwork.kernel.org/project/chrome-platform/patch/20220209095703.= 517608-4-tzungbi@google.com/) - Change the patch title. - Simplify by initializing wake_enabled in cros_ec_register(). No changes from v2. Changes from v1: (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T= /#u) - Use imperative mood in commit message. drivers/platform/chrome/cros_ec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cr= os_ec.c index 25cd8df6e7b0..b6604a9ab315 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -191,6 +191,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) ec_dev->max_passthru =3D 0; ec_dev->ec =3D NULL; ec_dev->pd =3D NULL; + ec_dev->wake_enabled =3D false; =20 ec_dev->din =3D devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL); if (!ec_dev->din) @@ -383,10 +384,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.1.265.g69c8d7142f-goog From nobody Sun Jun 28 02:50:43 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 545A6C433F5 for ; Wed, 16 Feb 2022 04:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344424AbiBPEh1 (ORCPT ); Tue, 15 Feb 2022 23:37:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234726AbiBPEhT (ORCPT ); Tue, 15 Feb 2022 23:37:19 -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 11B91F4063 for ; Tue, 15 Feb 2022 20:37:08 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id c10-20020a251c0a000000b0062272fc32bfso1821033ybc.17 for ; Tue, 15 Feb 2022 20:37:08 -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=OKBUHG1lRWv0hIHjB+K86/IQNwkPb8MQNKlRJE3S5/M=; b=VUKQadDEbJa7NbTRkkm9nXOiw5f7n4c/vBTT4/HCJWwWVQPU0Hjj5/WouVFgkdx5r0 5HaPzh3tug4Nku+8HqNjqBnLZItmom14x7t1m6cm4N0zVIgXoKyRrluJCmlSMKeqD/UK Za0giSQCOFnj+d6ofgO3QQVjdR+6tDdSU8xbQLEZ+Symgkh1gEcRuoNrkMxTUY1UIuWF MatIw38UqS1LYMThe7hED4+dLLc5p+CSgkFORU/SiXdNOewheb0cvViesjOGgoxcTlgO VAFKdNQRjz6+JUmG0cYis3eP8Nnwwxr4ZALSNHtrNuzM09shesfSvxvSGF39jKC0uDVj B+bg== 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=OKBUHG1lRWv0hIHjB+K86/IQNwkPb8MQNKlRJE3S5/M=; b=bZr8tnue6jqA+vXBbK92MucgOltk2lz4HNCSKaM6JH140r++zZVh9cSUHtaR2Jcj7B x5aFc7As65pcEMCba3W+KIWQRpqY1aCo6mKFYzFcWkVEi8iRnezX3dkvBIcG6onlMLCH i7CQAcrog3DGNijBD31vXhAMdWH20Juh4EbnhlzAo24OIOMaFZyFpLJcr9K7xGvLnbFj I7X7VpDJm5q+uT6O/G8DvXndOBdcxdbOenPNxqnG4J8kD7MotIRO5m7s2Io14y5Y0/ed L2/RyBa+ka4S54P67RMQ3gi5baB4/jlRA4KMrz9LPXWq4C5k8STkvGbIQ/kwVZhtxWDL pkwA== X-Gm-Message-State: AOAM533olVzZd9+cd8mpFdkCBswsMOUFcGum32EBaPPNPrA3/v+Psbfn vSH0w1jUrWS/R/T0BCn0BFOYBRm/eXOD X-Google-Smtp-Source: ABdhPJzsgKkCNM0CwKrs5c/H0XxeTDPiDod5RuJfAv1iM/iFm/zfXxW9uh5NrhHf0S5CbIQ38ur+wObnWL3B X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a81:49c8:0:b0:2d0:ad27:5be5 with SMTP id w191-20020a8149c8000000b002d0ad275be5mr895168ywa.27.1644986227331; Tue, 15 Feb 2022 20:37:07 -0800 (PST) Date: Wed, 16 Feb 2022 12:36:38 +0800 In-Reply-To: <20220216043639.3839185-1-tzungbi@google.com> Message-Id: <20220216043639.3839185-5-tzungbi@google.com> Mime-Version: 1.0 References: <20220216043639.3839185-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v4 4/5] platform/chrome: cros_ec: sort header inclusion alphabetically From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@google.com, pmalani@chromium.org, linux-kernel@vger.kernel.org, Guenter Roeck Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Sort header inclusion alphabetically. Reviewed-by: Guenter Roeck Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih --- Changes from v3: (https://patchwork.kernel.org/project/chrome-platform/patch/20220209095703.= 517608-6-tzungbi@google.com/) - Add R-b tags. No changes from v2. Changes from v1: (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T= /#u) - Use imperative mood in commit message. 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 b6604a9ab315..a3921fe5813a 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.1.265.g69c8d7142f-goog From nobody Sun Jun 28 02:50:43 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 80606C433F5 for ; Wed, 16 Feb 2022 04:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344437AbiBPEhb (ORCPT ); Tue, 15 Feb 2022 23:37:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344419AbiBPEhX (ORCPT ); Tue, 15 Feb 2022 23:37:23 -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 1E934F1EBB for ; Tue, 15 Feb 2022 20:37:12 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id x1-20020a25a001000000b0061c64ee0196so1874474ybh.9 for ; Tue, 15 Feb 2022 20:37: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=ZVCaTafRnnf5d3inHCDQdPKKWocYJyu5eiZME/8lYHM=; b=Lp0pe85DVhHiZL5qfP+SkXpvO95oZbjOtle8vsjMApUQZu9ZrMDoRO2I1jat8A3GSt JSgLehb4yIHAaOsjvDi/3eTh10v1ZIPQf3VcR/ny+oli7hkGoio2fvuYcvF1YSTUzv/X PWccAqwLhuZ2HAoGJshdp1qFnzAoIHBAaK46WlfCmKj/QlbjIqR6zN/FqaXLuR4eYDKM rUcfNpxKQVvUW0bzhxvUQFN7gmk40k1O8ELDrbI7NmnfWWbB4GTGSWfJgC28KYyEBti8 aujsN3ee+Cq/E4h6enmRBnyJqaXFH1gukgjCDLDb14XslPquNSHnKEalKMkIEuBW5WgM PqTw== 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=ZVCaTafRnnf5d3inHCDQdPKKWocYJyu5eiZME/8lYHM=; b=vo/7W38pQAhYXGNxrNu4fSTwMdWKwySVi4XnnVr0cI7WVDgaEPy9uTGxz4Rg0LBate lWr0YEt3LdP5JJULL+4+7GF0vNemRPoOWqQHVy2VaDUGgDfT2+RF4N+PZ4RJlzZkqBjJ lGXb3tQJP0jR7LIiiIYdyvewlHSYalM3bzEN5gmQBtofGneBRKC7tvP+2zC1fY64hvwm Vu2xTJF9ufLCU6C7icRRIDfkHAJiN2TtaKH84FD5Vre3MtjnzFwbpodNV3nXV31xLEow fp+BEAbqhGpo7KnFUzreaPsL7bjgTvs/hqqtac8ndXAH5GXumIJ1zstpOKHKxmuTNY+x 16og== X-Gm-Message-State: AOAM531GFhSGAIQb1wwZ9MEFcKEWzQBJh/JH8rjj2lPZMTij4B/VqEmA AqdW1ZSK6f6zEDnzF/Ys+LNo3QhMYASJ X-Google-Smtp-Source: ABdhPJxkeYjK1cD1AfT1ZUclFMK0x5SOz6XYbqagS0Uf3dXTfmZJWGMDkeXbVnqZ4XYm/AJO4n05WNGK12zi X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a25:20c5:0:b0:61d:eeef:cc53 with SMTP id g188-20020a2520c5000000b0061deeefcc53mr751041ybg.150.1644986231395; Tue, 15 Feb 2022 20:37:11 -0800 (PST) Date: Wed, 16 Feb 2022 12:36:39 +0800 In-Reply-To: <20220216043639.3839185-1-tzungbi@google.com> Message-Id: <20220216043639.3839185-6-tzungbi@google.com> Mime-Version: 1.0 References: <20220216043639.3839185-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v4 5/5] platform/chrome: cros_ec: append newline to all logs From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@google.com, pmalani@chromium.org, linux-kernel@vger.kernel.org, Guenter Roeck 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, append newline ("\n") to all logs. Reviewed-by: Guenter Roeck Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih --- Changes from v3: (https://patchwork.kernel.org/project/chrome-platform/patch/20220209095703.= 517608-7-tzungbi@google.com/) - Add R-b tags. No changes from v2. Changes from v1: (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T= /#u) - Use imperative mood in commit message. 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 a3921fe5813a..a45bbc589928 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -216,7 +216,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; } @@ -267,7 +267,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) { @@ -338,7 +338,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)) @@ -381,7 +381,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.1.265.g69c8d7142f-goog