From patchwork Wed Feb 16 04:36:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 12747934 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CCB81844 for ; Wed, 16 Feb 2022 04:36:55 +0000 (UTC) Received: by mail-pg1-f201.google.com with SMTP id bj8-20020a056a02018800b0035ec8c16f0bso584967pgb.11 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=g+ESV/3shhLU3FLgA1AIuvfbleMKvBq2Ey3Vsg91itlZNCT2nb6uWSeGkCFOFTIkAc sF2PMfhvLo55l9XCyzhALNtQ/8FcX2fzN2f+u4WfLG/U/0NzjYMELIDTWAABX6d93ZxI OwnloMId4y5aBd9kLdoYNX7oHFJ2LJVepFgOMDkcgJObkN/oxziAolMrmy1Uf0xTm2Jz HvRWi0j92O4Qk8FaRWYI3aE1icnrFLccD6mMZZK/rCGImfAS7qSpLmQp2dKyJS0xCBpL 5qINuiSIljJd4wBb9q9Z4HNwt8E9QZC0H+IfZin5cNTeiI5NwgPxjUZuPUWz0zj26fkO pBeA== X-Gm-Message-State: AOAM531TVtKSLjcWpGTbGuC1nIDCl1oGuKLD1sM5PGqdpLhRSNliOPbl FwE4hn2XUBbrNo12XYIEOFCEHHvRH4Np 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> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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 if 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/cros_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 = sizeof(struct ec_params_hello); ec_dev->max_response = sizeof(struct ec_response_get_protocol_info); ec_dev->max_passthru = 0; + ec_dev->ec = NULL; + ec_dev->pd = NULL; ec_dev->din = 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 = PTR_ERR(ec_dev->pd); + goto exit; } } if (IS_ENABLED(CONFIG_OF) && dev->of_node) { err = 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; } } @@ -278,7 +278,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) err = blocking_notifier_chain_register(&ec_dev->event_notifier, &ec_dev->notifier_ready); if (err) - return err; + goto exit; } 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); return 0; +exit: + platform_device_unregister(ec_dev->ec); + platform_device_unregister(ec_dev->pd); + return err; } EXPORT_SYMBOL(cros_ec_register); From patchwork Wed Feb 16 04:36:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 12747935 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 405731B69 for ; Wed, 16 Feb 2022 04:37:00 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id b64-20020a256743000000b0061e169a5f19so1858477ybc.11 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=L03frraU0mq5KVsYzHuUx84JoWVtoM1mJOzZxecdW4hi/Y6FxGkl1iOQy79V2SLTX6 JOmAq4MwZPeLity3n5STMxTBuY/pDMAV8UjYWfCTyPA3gksIpXxtBHlsRkvQFwhBlVKC zfA/eY9asXS1iBGwlxHLfgpzwgoinWSTN1XsBEVSQxZwbZeIzovw00k0ywlQvf0dWc9N vbZN78fcRE5i5IVvx1ndekdHfVjkgLPV25Ld6dlgm7affiDrdfUBsrDL9Q29FCdjQJCl Vp/wyqgJGqBN2B772ST1aoseSWOUuulyxib+onb6h6odxqoBavvsnZ2yqVb5LEt0UAvM Qy8Q== X-Gm-Message-State: AOAM530DhGk366o29aFFkq8drEWKlTD4zExj43MhTEXb5l4AIfBcUjAR u+8/6zLYQ8kuzPWIS0HMzbWYXV12eG77 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> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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/cros_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 = !enable_irq_wake(ec_dev->irq); disable_irq(ec_dev->irq); - ec_dev->was_wake_device = ec_dev->wake_enabled; ec_dev->suspended = true; return 0; diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_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); From patchwork Wed Feb 16 04:36:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 12747936 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F1731B69 for ; Wed, 16 Feb 2022 04:37:04 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id i205-20020a2522d6000000b00622c778ac7cso1927398ybi.3 for ; Tue, 15 Feb 2022 20:37:04 -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=heiLkVfnmgZ2ODEgvBpeuFpiGoitMfTkldF+SoEvtpCDlWBd8KFMfslP9A55Cx13cQ hjZv3C3wLOCdegEg+KVlvq4pZqzDoB+NV0qH6W3lF1ghxg/64k3JMmhWnYbdyuBJiNsa fDyhT2yaB3xzaF47E5mST4Atvdiw8eBJ6d9fKCdrY4GKQ015EJPCm70XRV0IJTNlcCSi PNdB3N25nt4bkUuL3bSEI4w5x8nP2H6hDQnt/YcJxVjs82BbhURWjOZpYAh742Po5sDr ZCnEJBEUZEZU2Dles8k60fNjS5C5YTsRm2SM1O5cXx+agQrRqVbNjHEpOkz/1W4Hps1y HRuA== X-Gm-Message-State: AOAM531DUa2uAXMwX39gMGYydSuvaj6YcSX5Jt7Pl+Y9JCTAQlBCZ5wn c0ndk41laUvB+/LNrxG7kJ7Zi7zG65pL 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> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 `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 Reviewed-by: Prashant Malani --- 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/cros_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 = 0; ec_dev->ec = NULL; ec_dev->pd = NULL; + ec_dev->wake_enabled = false; ec_dev->din = 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); - if (ec_dev->wake_enabled) { + if (ec_dev->wake_enabled) disable_irq_wake(ec_dev->irq); - ec_dev->wake_enabled = 0; - } + /* * Let the mfd devices know about events that occur during * suspend. This way the clients know what to do with them. From patchwork Wed Feb 16 04:36:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 12747937 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E3C01B69 for ; Wed, 16 Feb 2022 04:37:08 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id s11-20020a255e0b000000b0062277953037so1782094ybb.21 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=H064IKjIM25YMT9Tasuya1eQtZNJaDLQmE5O/oUklRD0OmBqRyAeDVsOFB8NNnvI1X y3jFogGkr8aFj6s2kFGDQxsNcLNBuK4+w17hKF+/16rdcyZAnarmXUlAsXoyXIx9Swow OluHg0N/KV2cLr5ruRSJN/m5YQ7fcYE/kYCylNvoLMETIdgtrpYWTI2X5M4a8uRyXxTB 2uMKELKJ0F2Er4/a7abVtohGAyxZ+Y+FB4vYpRsPVUg+ul2EBAzM39pQ8YsFTpJFkmUU oJuY18k0wAj4oQHEQcURyaAbPz3yX4jDltpB0f6b44P4RioI08BPmtsh1YkxF+0UDwMh ZO4w== X-Gm-Message-State: AOAM531S332+dWL1X3jl53o1w1LSfci78zP8Sm1aJS6r+8Nes/XC+dYt VHcscDUBeu3Co/ysbikIjBujlPvqt2j9 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> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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/cros_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. */ -#include #include -#include #include +#include #include #include +#include #include #include "cros_ec.h" From patchwork Wed Feb 16 04:36:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 12747938 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 382601B69 for ; Wed, 16 Feb 2022 04:37:12 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id c10-20020a251c0a000000b0062272fc32bfso1821257ybc.17 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=LqfS2KnbUTOEEns39xU9U36mh781GP8XUbUxDGTW0oExbBzbjERFHDssMinU5VIIDo RFSoLRFUR+oM/S0ICFEPFTnv143yJx4/882MRCW2DaQkpxhve0mzJqyQEzdYaeN64/el MHG5HSWWkREfgpnI8to1lL+gWkjSbg0LAxOqpUMzjhBygMtabwf3ZhnpwoiPOsd5UPBY MHidPNK7k3Q8adgRNbnHCwGii4ahD1YTDGkPUg43k2ev2r2UmHonm01xxn0xRvBvXTli U3jcu9HjcFPbbAZp3Tb6Gn4zG3nQ/UGfRY1uXG+prkzpIlvRJI3DyzcOoSFWjMz/QYzm 3P3A== X-Gm-Message-State: AOAM531KIRbvdzcqSzNah2+4U920DBQ+jopZ4zadbmrpCGDYrIje9Nb4 0KYXIjDh9NdeJ0V9OFBfH4hrSJURM2Pb 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> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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/cros_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 = 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); if (ec_dev->mkbp_event_supported) { @@ -338,7 +338,7 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev) ret = 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); if (device_may_wakeup(dev)) @@ -381,7 +381,7 @@ int cros_ec_resume(struct cros_ec_device *ec_dev) ret = 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); if (ec_dev->wake_enabled)