diff mbox series

platform/chrome: cros_ec_lpc: Handle EC without CRS section

Message ID 20250114202122.2352277-1-gwendal@chromium.org (mailing list archive)
State Accepted
Commit fccebbdde2067e359f01382a72c31ed2af7acbac
Headers show
Series platform/chrome: cros_ec_lpc: Handle EC without CRS section | expand

Commit Message

Gwendal Grignou Jan. 14, 2025, 8:21 p.m. UTC
Fix logic to support GOOG0004 device without CRS section.
Instead of failing, assume there are not memory mapped EC registers.

Fixes: be4fccb5e1fb ("platform/chrome: cros_ec_lpc: Support direct EC register memory access")

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
 drivers/platform/chrome/cros_ec_lpc.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Tzung-Bi Shih Jan. 15, 2025, 1:31 a.m. UTC | #1
On Tue, Jan 14, 2025 at 12:21:22PM -0800, Gwendal Grignou wrote:
> Fix logic to support GOOG0004 device without CRS section.
> Instead of failing, assume there are not memory mapped EC registers.
>
> [...]

Applied to

    https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

[1/1] platform/chrome: cros_ec_lpc: Handle EC without CRS section
      commit: fccebbdde2067e359f01382a72c31ed2af7acbac

Thanks!
diff mbox series

Patch

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 288ef9198bb0a..a878758b9211c 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -562,11 +562,7 @@  static int cros_ec_lpc_probe(struct platform_device *pdev)
 		 */
 		status = acpi_walk_resources(adev->handle, METHOD_NAME__CRS,
 					     cros_ec_lpc_resources, ec_lpc);
-		if (ACPI_FAILURE(status)) {
-			dev_err(dev, "failed to get resources\n");
-			return -ENODEV;
-		}
-		if (ec_lpc->mem32.address_length) {
+		if (ACPI_SUCCESS(status) && ec_lpc->mem32.address_length) {
 			ec_lpc->base = devm_ioremap(dev,
 						    ec_lpc->mem32.address,
 						    ec_lpc->mem32.address_length);