From patchwork Wed Feb 16 08:03:02 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: 12748135 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 03EA61B69 for ; Wed, 16 Feb 2022 08:03:24 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id 128-20020a251286000000b0062234a636b0so2646431ybs.16 for ; Wed, 16 Feb 2022 00:03:23 -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=QwbIJmiyLmPJsz2898M/cKW1wrJYaBVyOrGjlzPUzPM=; b=QKqEMCGcSx2J3hQkVkRuvqwH+mW4FQKm+Y0JL6wkgcPIwTDVabKlRaTr/qFFPbehup Ca3LeujYdXNC2VCz41ANfKgS6oBnpOEROXSNTqS3bVDU1QaF348xv3+8kkZJJotyd2V8 E3kIVWLjfK2kD8yg8EqixIMvSLRUg43RPHZX30hlfDiBKbzj3gsFQT9ZBZp3ZxjTqwQm CUyctzVDYKtaqZBbn4xM8Pa2U1hRSYnv6YWzffTI233Go/qCJNk8FgvJz1inn3Dp7YNC V/9snbueLCPDnKiuBQLE77JmbrEo2JTPgJQXJHXY4Q5zTBBvNB1+cQGjBquckXK404Fe uxGQ== 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=QwbIJmiyLmPJsz2898M/cKW1wrJYaBVyOrGjlzPUzPM=; b=Nvh6geRKxdT2GFxn2LI8N1B22f9p6H0fRntx8JMi4mW75A2xD+3/ZvJWBcYrYXly57 A73t1rLoiBSXakoW/XPQ763smakFxgJXwGLSmW+BLaF93duJnw8C46GvI4OdWpvjayCS STQXWszP6yzBZG5hOpkjFjTuF8mCH8qBHCik9+99Y//nFsv1KXBu92u7X+QLidZM4Zqv 9IiX3kL2pRyfUQQiftm+/V7n/KwwnN3Xf8DN6quxLQLHEjHo/nu32woXk267iyD0kE9r HvcomHBnFFR1Y78a4xbl2F72RgrYMDc4y0kXeYsH4EeQyxglqp3B3YdqOm8Y6oLjuauI f7Og== X-Gm-Message-State: AOAM531oaBHRGvdzMXrjbYnvAcxd9lbNlb1l05mIzUZjvApMrHFwnG7Z MIpxRA03ueSgp4EqDYhQQbccFsW08W+e X-Google-Smtp-Source: ABdhPJz+DlHTqa1DwdMIlck0KFDFQurTMv/sTMydH+BMvolVF8Nxsj4O7axBlt5IlDG82yTYuLXvIRhG4Ygt X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a25:e802:0:b0:60e:94cb:dbc0 with SMTP id k2-20020a25e802000000b0060e94cbdbc0mr1056681ybd.509.1644998603121; Wed, 16 Feb 2022 00:03:23 -0800 (PST) Date: Wed, 16 Feb 2022 16:03:02 +0800 In-Reply-To: <20220216080306.3864163-1-tzungbi@google.com> Message-Id: <20220216080306.3864163-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: <20220216080306.3864163-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v5 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, pmalani@chromium.org, tzungbi@google.com, 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") Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih --- Changes from v4: (https://patchwork.kernel.org/project/chrome-platform/patch/20220216043639.3839185-2-tzungbi@google.com/) - Add R-b tag. 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 08:03:03 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: 12748136 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 5170D23AC for ; Wed, 16 Feb 2022 08:03:28 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id a12-20020a056902056c00b0061dc0f2a94aso2724451ybt.6 for ; Wed, 16 Feb 2022 00:03:28 -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=1aDHrU0OAcezWyAKSlCofgKbepJMdH6+ryrRYnqT3dM=; b=m3Sv/VM/AlkzDd57mYih9LNc5rNzE8uBAoQF+vV9+aWQnFJQxTji5+HbY31hng1WA5 GCfsFP2zAmvphqMab7UKlG9U8RmvsUoBFfyluy0WN4Rg42Mo1fETKvNiR2BV2XnbLHis ipuYLauO9EQ5q0Tu+OIPQ13DpfgOOV+5S8sN2N9/u1AVAuaeGzcwJQ26ADm0om3OOLWU teAGfdXE+N6iv9PgAywSz729pqw4xhin4KNIjb5EELI91ItE3uC0SZKhjKajM1KmF4r9 HOWw35rpM9zkF7lUqa7L1VTycERYigL6dK+tTvgsXMl8ZZUMEX5m5V0nT4O/brE9LKrg bCAg== 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=1aDHrU0OAcezWyAKSlCofgKbepJMdH6+ryrRYnqT3dM=; b=b8JDRyxPfYIS94h5eKAUmST6qfeoNBdTOsEvkIF90b0EHeHUNijsyQRHF00HsBu6v8 JB39onyrAynizIVOnjg1sj0lMG3ylgysZHyj0k1x/7kIjSSBrlWtTqBaXsUq89GsX9JT DYTvrNmdUbm6eR9YAOrEwduyl5zb1wpRu+nkTvZd7Iyv3SdAdSCYHlw/DQJkLKARShGw /b+A3tiX9/o01xasOP7JVSDRSZmewl65ZPbRMk4HuWc5lyvebUM97qQr6ABrSBVm834x OD6RdJjarresM2cN9DkSstrgBlpLxEw+fzzNs99P2ED3xye4u7D8tRDsXDzrcXzdOzWD YTuQ== X-Gm-Message-State: AOAM532xAMBcDvZ0HqNSDk7nTeF9YAOEcajKJuRewNEMtdOJVYz+HM15 tpIvvREgTA3H2UzmjRI0o0Cm5WPJZf/u X-Google-Smtp-Source: ABdhPJwnL3ty0rYB/mTS6ohebP4mDHDFhYi+THLa6qb0jeK6tO/c5ZPJ75AyiazmV9ig+lSOTxgPMQ+iQI11 X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a25:1402:0:b0:61a:9815:b84b with SMTP id 2-20020a251402000000b0061a9815b84bmr1121925ybu.573.1644998607466; Wed, 16 Feb 2022 00:03:27 -0800 (PST) Date: Wed, 16 Feb 2022 16:03:03 +0800 In-Reply-To: <20220216080306.3864163-1-tzungbi@google.com> Message-Id: <20220216080306.3864163-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: <20220216080306.3864163-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v5 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, pmalani@chromium.org, tzungbi@google.com, linux-kernel@vger.kernel.org Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih --- No changes from v3 and v4. 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 08:03:04 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: 12748137 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 819FC23AC for ; Wed, 16 Feb 2022 08:03:32 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id b12-20020a056902030c00b0061d720e274aso2636676ybs.20 for ; Wed, 16 Feb 2022 00:03:32 -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=SE1MVdE6VYYgYy0YdvS/4bDSsAOzBU2OrOAH/ZUOnFg=; b=oeGfckUJe6Fgl8bC2ziCgYFPG71l9XmLh+g9L4Yq4ppJfmoLfhqaRT7PhyCF92nQa8 4j96bF3sQyGxNkZO/f1cnd1NQ909E/VE6a9nhLAA77BAfpEnT37UN2A9eC49FdNvXi6R cPuzJXe8hRvI79/fT5VfcPQInUsduFGfWbrkcYbuDfDdbB6CVUtn9XdHp8qzDc6X7oVG WtOts4TH2CYXrGzhymjUWttuElJqDwNCNmUf3GiuoB/I3rrg3YaZncqrSi6s6m5EixfI 9j2uLGPci4eqhqDXA+YsoAXY9Wh3tZRmCib2wcZRL+Et7EiEZ2SGmN7Wsl77xLlbx0yT 7jfA== 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=SE1MVdE6VYYgYy0YdvS/4bDSsAOzBU2OrOAH/ZUOnFg=; b=hIx+ohMuHS8GZm9zZBhM2I/5J4fmxF+eTW/R+RzKyDP2XI4+B9sKCvlYziS/dnXhfE ET5siyrQFKvipVm2y8kFtdfiHvNnmhMGKY3hJEEZfimo+UBBaUgZYt+f9Z4pBaaRKxmw VaZMKWkfSB/rEc6YzZNez4Yg/nTgd7osBKFI0OGFLINwOpK4hvfmUkTjz6a6iQ4/z6gJ Jqd8CkSbSDl0SFGBs5QvmcPNE2erZLAc1asLHExeouDEExMsNKFDOYH/iK6Q00C2vPfb zjXHjli1Y/WENAk3JtomQSznEY9ao+RXO3BpQsWx0MFvSvVMF6W3GG4ZygF+sgG4noCk 9vAg== X-Gm-Message-State: AOAM532vWM4jLfo6+tUAGN4pfgpW2c/vjEUe++2i86EcQpL0ZxUC+/WR /fTWfFe3e/Q0ibkhiNs2L03Bb9juJXFz X-Google-Smtp-Source: ABdhPJxMKIQf7axeUM4rmevbTIpLdf4pXF/mgLIQe7ZVC5J4o0olbRMFcXkad1Mnde1GqBRBGMAZayKoyZu7 X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a81:7707:0:b0:2d0:dc96:5729 with SMTP id s7-20020a817707000000b002d0dc965729mr1398343ywc.37.1644998611613; Wed, 16 Feb 2022 00:03:31 -0800 (PST) Date: Wed, 16 Feb 2022 16:03:04 +0800 In-Reply-To: <20220216080306.3864163-1-tzungbi@google.com> Message-Id: <20220216080306.3864163-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: <20220216080306.3864163-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v5 3/5] platform/chrome: cros_ec: determine `wake_enabled` in cros_ec_suspend() From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, pmalani@chromium.org, tzungbi@google.com, 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(). Determine `wake_enabled` 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 v4: (https://patchwork.kernel.org/project/chrome-platform/patch/20220216043639.3839185-4-tzungbi@google.com/) - Undo changes from v3; rollback to v2. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 25cd8df6e7b0..a013fbceeb03 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) if (device_may_wakeup(dev)) ec_dev->wake_enabled = !enable_irq_wake(ec_dev->irq); + else + ec_dev->wake_enabled = false; disable_irq(ec_dev->irq); ec_dev->suspended = 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); - 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 08:03:05 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: 12748138 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 B192B23AC for ; Wed, 16 Feb 2022 08:03:36 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id 128-20020a251286000000b0062234a636b0so2647545ybs.16 for ; Wed, 16 Feb 2022 00:03:36 -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=5qzVLz39P8G9OalJ4OG5+jRLXwbeqjg2qWS0xq1akwM=; b=Zt68xi5ETqf1AmcUeuq3ib3RwFunxoigHxeX4oruUT1ON8IYS1e5HH57S7oZhXaOsf lQUppbLjWJe645AnEI28KBFMw3wGt9d16s8XxdeHG0hgOfa9m0va4ZJsq+OvZrlF8iAE k9fg0a5WwdMak8ryMGAL4ruVOC8cZN/fqrcG8Zhv7AbqjpyxzODOHGCSvm5hmqZfhgEF SJQtMINdk8NoYNUcLD5VWvmhs2WOofypKOX4l/bFZtbiR0JWHaM1KvYa4LIvq+hnsK02 FO1fere4I1Z2Oub7t3kwrVCYpZxwUGPnmFcYkZtBG/COKzdtk5R6ul3HMYFrTgB32c1x 2cEQ== 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=5qzVLz39P8G9OalJ4OG5+jRLXwbeqjg2qWS0xq1akwM=; b=ll+5s/g5zC8Bx4HuluyAaZThKUAxRXIssmA9ZQSFvN8wY0FqJ2qGOinpf9v2MJLMJ3 L3Cl4nxbEXabSyQgTarLBKzJ3gjXVF4IIXffGVIa/S7jeWZlSqEOodi8haW0vACKR4V4 oDC+wfRjWX4WuWDwsLnLN6LQ2e6WAPZSfyErop4QYcNs1S8O7fXjHCSunOJwTbwzrB6s LC1U6q4+Dp1eS5uk0Blw2QFbDrB4U3ufitN0i9PB7YkYV/aWXVCtBzm7RX+j99+GvOV4 bT2clq1I8FQl4G2zs48sQvmuKqGWjp6oyHQ3EAsE9vB8w3+LprMGJqK20QIEd/N0x5Yh 7ZSw== X-Gm-Message-State: AOAM533g6JB6idXaYlRr73bmXb5aZEaNixtJexnP/7TGXYDKvSvozJSy E/yT7vooii9TqRmu8fGDdZyAQJGJZucw X-Google-Smtp-Source: ABdhPJxuoL+5eeFURcGTKeIxlEdvNBxd1Inw7r0oDhOhJ1nc7+k4RTjtYrDB9xE1YHMUHY0ThoqlAGBTkHgf X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a25:68cd:0:b0:619:8e35:2c3d with SMTP id d196-20020a2568cd000000b006198e352c3dmr1133711ybc.266.1644998615855; Wed, 16 Feb 2022 00:03:35 -0800 (PST) Date: Wed, 16 Feb 2022 16:03:05 +0800 In-Reply-To: <20220216080306.3864163-1-tzungbi@google.com> Message-Id: <20220216080306.3864163-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: <20220216080306.3864163-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v5 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, pmalani@chromium.org, tzungbi@google.com, 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 --- No changes from v4. 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 a013fbceeb03..1e1a24a80d9f 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 08:03:06 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: 12748139 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 0F9C823AC for ; Wed, 16 Feb 2022 08:03:41 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id z15-20020a25bb0f000000b00613388c7d99so2726469ybg.8 for ; Wed, 16 Feb 2022 00:03:41 -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=cBsOjcPnmLH7/AqklcuehpI9b0p1xbakmUIE5IP9keU=; b=IOikt31P2zEAtluISzAwx5beeMxSU+NsFh4G/wCC2BPZHmo5C2myILKNgUnhx7jIsr 5u1gca1R0sgoUJXWzmNxx+IPiBlv93cY3G2d66YrxGpcD9nUwzXrBzESt8m3gnuPVXX9 Z2f4kXgs7fxoOwbtzUyUbhBMrSiwMuGA5+DN52h/GSaGYQU4LEK9G7b7vRskRbg6zNiQ 4ntsP7jnUj2Pb/JpFYBObmW8NZdFH7XwtW+/mdOH8cz9GDqHH9+lHuNeqJx450ymbW1F JEHs9Q0IJmyclfGlwjN8NQUUPF0l48kvAfWwRBA80U8jmjZoHMadvGHdk7mDydWCUGm3 5FWA== 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=cBsOjcPnmLH7/AqklcuehpI9b0p1xbakmUIE5IP9keU=; b=L2x5mZql/JwozpyrI57n1r9ecrtnddQuLddxM+gJpqaEgtJxiFuUkSoi+6X1Nq9vrP h2tXTxPSgoOpkqZum7Rsbrw3FaTLmiGjMjL33OcrnQTiMsZ1i5pXCDLrog4ll3XC7RLC eCIFvIA3eXviQP97sVq5QzYNguCeU6sLJ4YUIMNoYl4W7la0sCwyncx4ShKsDQGaKYbB aBKhPwy4W7h17UpUuO5L6Xn4YyEAKIddZWYb2ZHcAVXvJTWOR/LOrgNWONjtbCLea6+l Se1VVm9eTnW0bE0I+RcY7m5u3vqgIRa8gHg4LbEcFWxx9kJY2D9zGKlnYPFTyriHSx+J L/Jg== X-Gm-Message-State: AOAM533r93RMFA6V0Ktue6+CG1CAg5A41WTVn6tm6sMQ99Wp+XQaoUjn UiTE690Olq/ETYWhgEU+GosjK+xwpVLn X-Google-Smtp-Source: ABdhPJwIKjl5qpVIgCVJ6WFHe5Q6tyytpUjKF+fO3a8yu4ekaUbz6G5cuNxkcJXUaxbtAWEwmzQeSHmbSR5p X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:10:8ce7:5b2:9787:1a0b]) (user=tzungbi job=sendgmr) by 2002:a0d:ef82:0:b0:2ca:287c:6c5b with SMTP id y124-20020a0def82000000b002ca287c6c5bmr1424157ywe.256.1644998620185; Wed, 16 Feb 2022 00:03:40 -0800 (PST) Date: Wed, 16 Feb 2022 16:03:06 +0800 In-Reply-To: <20220216080306.3864163-1-tzungbi@google.com> Message-Id: <20220216080306.3864163-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: <20220216080306.3864163-1-tzungbi@google.com> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog Subject: [PATCH v5 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, pmalani@chromium.org, tzungbi@google.com, 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 --- No changes from v4. 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 1e1a24a80d9f..1395c764d938 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -215,7 +215,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; } @@ -266,7 +266,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) { @@ -337,7 +337,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)) @@ -382,7 +382,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)