Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1235312rwb; Tue, 29 Nov 2022 10:37:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf6QNjY8VLkIqIkgpGZH7lmIyqC7u9bZafRx/Ejq16naTJJViDFz3LTIqOsMAqJFE4JloxlB X-Received: by 2002:a63:ff63:0:b0:477:8d4f:3dda with SMTP id s35-20020a63ff63000000b004778d4f3ddamr35583530pgk.552.1669747055379; Tue, 29 Nov 2022 10:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669747055; cv=none; d=google.com; s=arc-20160816; b=kWOwZkzGrafO442wAzcXgp55+EBahTkZ0h3fo+kulVJRb0TtPDEFDftO5vezgqSLTQ nd4ych+aUxnrKJwbVHiQP6+nOke+FTlU9E6ID1L5udBBrG5kzpItq/OSsBvzPd8YRBUm ir7SP4wvJiSL5vhQ8Z+2zTlYxpuQGrW6z4bn+2X4AOUv7CBOLCPV09TF79KlNtMl1MtG 0Lc3CMAypZ8LfqWXgbJazf27cyzg1IneXmq4ZATRqNk/0nbMeFqDSEfE1VlriApXJhsM g4uWD1jLMULJxoHla6nTBHJQkCzK82iSnVI8TNAW+lnQZTuo6vmyqMfrQfLVC0DS9PeL wehQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oxizSDtUrKGW9s75wfUhGFGOv1cbxYsbxzO0Bfc6NkI=; b=bHfNt0Sj6JdiCTlOeNjyvobsMDOZKo3eAL2Bpxiu2689KXIk7Bqw3e/NOHA25M0Ilp X7srQ4A2OeO8utBDBdhVkJtb1L+jjiadlSqkdmxGwM95EAu2hUhNoRaF8kWTxzFkzDMU aWk2J6b9eX0BcJdLFquQmO/SNAcX8794hGqfBng/gK7mCzFMTbzLmyNFjlvx0igpaMe2 LT0/QVmS0Wd0nCVNn8rcRvbsfnN1jAOAfTz6s7IGe1pyS+CxuL3GgEb8IV+FITf/1hyE 2CTEZCkIWIlTxSwgcyqzTfv0vJA2jRSoAgZLbRfmvBpory84Ha++DK2jUGH9Yvw278uO IAGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Eaz6vuCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h190-20020a6383c7000000b00477ff64b022si10368953pge.19.2022.11.29.10.37.23; Tue, 29 Nov 2022 10:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Eaz6vuCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235142AbiK2SNR (ORCPT + 85 others); Tue, 29 Nov 2022 13:13:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233743AbiK2SNQ (ORCPT ); Tue, 29 Nov 2022 13:13:16 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E1ABDF53 for ; Tue, 29 Nov 2022 10:13:15 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id d8so10405648qki.13 for ; Tue, 29 Nov 2022 10:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oxizSDtUrKGW9s75wfUhGFGOv1cbxYsbxzO0Bfc6NkI=; b=Eaz6vuCU7u00zWseDKdCYKMAVyDLlMsX995nhSluQCaJIl4kZ3Phky9xWJrvZSlDkX K//ngzfvIXB80SXU5z+0dquHREqnSOdDWMoxmy/DJ2gk1h70eQUC/xc5CmfoS2Rp9qFb cQwDvq6Rgx7Hdel50IMqDkWCaIoAjIqqZKJ8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oxizSDtUrKGW9s75wfUhGFGOv1cbxYsbxzO0Bfc6NkI=; b=T8N3HqZYCA3hIoOfpmw+d7ZfRyk0ILVNmoV4v3Hi+ExbA1M61yHHB8Jd4rn2fXYQ0O 65BEhxxl/3gWq5xhrSKBQidB5tGU/EvHViDog+2mvp28f4D3yCfbfsgdzXEG7hyuMLP1 Gsm7BOqqsOa3P2LxBoksSLpt2xafmePIvDZw2teQTfTsCV7UPwkoltJOj6afaycYLijA SVJDLkfxBAVQXdaXihOOjiRbblnAVB7jlHBu6PzB8nNRlN/KrRutL0lyRXoGeG3lmtK0 P6yLBNIp4sl/b2Ar42RUt1PVpsOGBBeuKL6wAU2N0Av8Jg54OaxEy21j8fiZsGwLoWUO EUgw== X-Gm-Message-State: ANoB5pnBpcgOebTyGcnzPdEnql9k99yCf4VpYLHtz4EpyywD1LBoi/l7 THB1XRr5E/lavKYGxlfCCS1o8cjo7mImAq2Kqg26lw== X-Received: by 2002:a05:620a:2694:b0:6f6:b34a:5333 with SMTP id c20-20020a05620a269400b006f6b34a5333mr51687260qkp.1.1669745594753; Tue, 29 Nov 2022 10:13:14 -0800 (PST) MIME-Version: 1.0 References: <20221117114818.v7.1.If7926fcbad397bc6990dd725690229bed403948c@changeid> <20221117114818.v7.3.Ie23c217d69ff25d7354db942613f143bbc8ef891@changeid> In-Reply-To: From: Mark Hasemeyer Date: Tue, 29 Nov 2022 11:13:04 -0700 Message-ID: Subject: Re: [PATCH v7 3/3] platform/chrome: cros_ec_uart: Add DT enumeration support To: Tzung-Bi Shih Cc: LKML , Raul Rangel , Bhanu Prakash Maiya , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , chrome-platform@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > @@ -392,6 +393,12 @@ static int __maybe_unused cros_ec_uart_resume(struct device *dev) > > static SIMPLE_DEV_PM_OPS(cros_ec_uart_pm_ops, cros_ec_uart_suspend, > > cros_ec_uart_resume); > > > > +static const struct of_device_id cros_ec_uart_of_match[] = { > > + { .compatible = "google,cros-ec-uart" }, > > + {} > > +}; > > +MODULE_DEVICE_TABLE(of, cros_ec_uart_of_match); > > It would need a guard for checking CONFIG_OF. Similar to what > `cros_ec_uart_acpi_id` does. > > > @@ -405,6 +412,7 @@ static struct serdev_device_driver cros_ec_uart_driver = { > > .driver = { > > .name = "cros-ec-uart", > > .acpi_match_table = ACPI_PTR(cros_ec_uart_acpi_id), > > + .of_match_table = cros_ec_uart_of_match, > > It would need be wrapped by `of_match_ptr()`. Similar to what > `ACPI_PTR()` does. I'm not sure we want a guard in this case because we compile the kernel without CONFIG_OF enabled for (most?) x86 platforms. Yet we still need the device tree code to enumerate using the PRP0001 _HID method.