Chrome platform driver development
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_lpc: Handle EC without CRS section
@ 2025-01-14 20:21 Gwendal Grignou
  2025-01-15  1:31 ` Tzung-Bi Shih
  0 siblings, 1 reply; 2+ messages in thread
From: Gwendal Grignou @ 2025-01-14 20:21 UTC (permalink / raw)
  To: tzungbi; +Cc: chrome-platform, Gwendal Grignou

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(-)

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);
-- 
2.48.0.rc2.279.g1de40edade-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-15  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-14 20:21 [PATCH] platform/chrome: cros_ec_lpc: Handle EC without CRS section Gwendal Grignou
2025-01-15  1:31 ` Tzung-Bi Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox