Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3392237ioo; Tue, 24 May 2022 22:37:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB75s8EDDOgqTelL3UVtMaHLTYKGbHFLODsIId0y8FrWz0L1nvgErJPVC8XIxYGinUEPHk X-Received: by 2002:a05:6402:1e88:b0:428:4782:a16e with SMTP id f8-20020a0564021e8800b004284782a16emr32159167edf.191.1653457052620; Tue, 24 May 2022 22:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653457052; cv=none; d=google.com; s=arc-20160816; b=ohQYL5AbMmiGuFaHlB3LqRayM10pT2UdC4bwKptWlObyFCQZ7T1DGLexvhTr4eI8TX 3cpm6x1QBnMZTI2dKuRrqcKPeUvmw1zY8m6EFWbMh3E2JFMgLmnvtnCRRxDVYhsskPOh tLf6ZvMM4HMhn3rv9iqAtoc4GVZD77KPD0ZWX84SUrAozKpuUxxQO1m9B6witS0wLpsR L1vJKReH0i9rvFI6RzrN7uexi90rUa766Y/WoAEQnOHLuBZPcU0fQ1wY952esz4jgRy0 ryE19eHQmYGqpedfz1grs5TFYnIUvbvgvzBqCJnGLgrhxo1oXSOxc6d4taenaRsHyZ0o /21w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=95joObH0DwG1ZqidG+ckHPbt1l+SEtovBpUjPuTMARQ=; b=k36rtbl6wpYJnSg/AQPJJ/FIqAyS9GMkOMVthouTB5rXQUCC4NnPCT7I7923tsLV7c 4hxW3ozu8P6GcZ/LLcZJTj/mXVTFdaG5k1F3Cbdkam+f4csDiDqb0j9EPm94py35kspT IZ0UdezJvyxgvgA5WITqGESRlEBzYgBKaKt3627ba7yv+Vhn04BPRculfrrdVFdI+9iR XGLcPtPyLdDYsQ6RDLHAoOsQZiISxGxGekNdGZBSQ2zr04S7JndmLBPw++VkK254GyXq utOQ8S29ZmgcybaHIJm2ejkKzmKddPH0spiFpKVxCreRal0V4trtNtcWxVh+jdRJa42t KGtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ns2bJ3hm; 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 oz37-20020a1709077da500b006fed8708e4esi8924338ejc.673.2022.05.24.22.37.07; Tue, 24 May 2022 22:37:32 -0700 (PDT) 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=Ns2bJ3hm; 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 S240836AbiEXUIH (ORCPT + 99 others); Tue, 24 May 2022 16:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbiEXUIF (ORCPT ); Tue, 24 May 2022 16:08:05 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 621B55AA4E for ; Tue, 24 May 2022 13:08:02 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id l20-20020a17090a409400b001dd2a9d555bso3200660pjg.0 for ; Tue, 24 May 2022 13:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=95joObH0DwG1ZqidG+ckHPbt1l+SEtovBpUjPuTMARQ=; b=Ns2bJ3hmUXS3Ha59g4WB/YCeIS3bfiBK+VHy4aBbe1YPC4MZF9l2OOdJcfOk7ryF5w 6+QZoe4GUkVROZYVFDPXQo3YvvAUN0P/BXYCBXe3apQDv2ob3+HIZvbme0DxJ2idLlNq w4opPNJNfYvRVge96SoQ75Palo0WcphPukuZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=95joObH0DwG1ZqidG+ckHPbt1l+SEtovBpUjPuTMARQ=; b=KwtXOp0geOVQgBJCykyJwaWQ86bddqM6a/OZMVuzc862lo6EdCm2ixmgbKuAw1tzc4 cRXrPo9IJpNTCHQjSjmDextqa4cDSMsXLS4WH/aRAFZP6XPJkLDSIu7oHyxHXnMIRI0c rxhaV+pdSx1Iug+5WwQLYCXMFeSuyhn9tN+enTZLmqOU+KcqLK8Ymf4kveoLL+/c4p5F JcszzoNQuZLhc1kT6s1RXSysHMJ5ZtKDbu9hezvHng/M/m5l3b/nX2f9x8ZHQEy/ysdj eZPOhRqpTGAvTvBuikoVJKaKAy+fKi1apb9Ez848BsywWNU4q8IHIZCbqVfx0taBSkOT F+qA== X-Gm-Message-State: AOAM531gbvkaQ/xq1l0iuRQqjWIIcaRryqKR2IS4fP3A8PZOnqCF9aHm Csuvj8nGq3GUP86saW8gPzxYvA== X-Received: by 2002:a17:90a:1911:b0:1df:b08a:e252 with SMTP id 17-20020a17090a191100b001dfb08ae252mr6241484pjg.215.1653422881823; Tue, 24 May 2022 13:08:01 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:d9e2:8472:9ac:8532]) by smtp.gmail.com with UTF8SMTPSA id d5-20020a170902b70500b0015ed003552fsm7632910pls.293.2022.05.24.13.08.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 May 2022 13:08:01 -0700 (PDT) Date: Tue, 24 May 2022 13:08:00 -0700 From: Matthias Kaehlcke To: Tzung-Bi Shih Cc: bleung@chromium.org, groeck@chromium.org, robh+dt@kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Guenter Roeck Subject: Re: [PATCH v4 4/5] platform/chrome: cros_kbd_led_backlight: support OF match Message-ID: References: <20220523090822.3035189-1-tzungbi@kernel.org> <20220523090822.3035189-5-tzungbi@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220523090822.3035189-5-tzungbi@kernel.org> X-Spam-Status: No, score=-2.8 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,T_SCC_BODY_TEXT_LINE 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 On Mon, May 23, 2022 at 05:08:21PM +0800, Tzung-Bi Shih wrote: > For letting device tree based machines to use the driver, support OF match. > > Reviewed-by: Guenter Roeck > Signed-off-by: Tzung-Bi Shih > --- > No changes from v3. > > Changes from v2: > - Add commit message. > - Add R-b tag. > > Changes from v1: > (https://patchwork.kernel.org/project/chrome-platform/patch/20220214053646.3088298-5-tzungbi@google.com/) > - Update email address accordingly. > - Use device_get_match_data() per review comment in v1. > > drivers/platform/chrome/cros_kbd_led_backlight.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c > index a86d664854ae..4bca880d7721 100644 > --- a/drivers/platform/chrome/cros_kbd_led_backlight.c > +++ b/drivers/platform/chrome/cros_kbd_led_backlight.c > @@ -10,7 +10,9 @@ > #include > #include > #include > +#include > #include > +#include > #include > > /** > @@ -116,7 +118,7 @@ static int keyboard_led_probe(struct platform_device *pdev) > const struct keyboard_led_drvdata *drvdata; > int error; > > - drvdata = acpi_device_get_match_data(&pdev->dev); > + drvdata = device_get_match_data(&pdev->dev); > if (!drvdata) > return -EINVAL; > > @@ -152,10 +154,21 @@ static const struct acpi_device_id keyboard_led_acpi_match[] = { > MODULE_DEVICE_TABLE(acpi, keyboard_led_acpi_match); > #endif > > +#ifdef CONFIG_OF > +static const struct of_device_id keyboard_led_of_match[] = { > + { > + .compatible = "google,cros-kbd-led-backlight", > + }, > + {} > +}; > +MODULE_DEVICE_TABLE(of, keyboard_led_of_match); > +#endif > + > static struct platform_driver keyboard_led_driver = { > .driver = { > .name = "chromeos-keyboard-leds", > .acpi_match_table = ACPI_PTR(keyboard_led_acpi_match), > + .of_match_table = of_match_ptr(keyboard_led_of_match), You need to put this assignment inside an '#ifdef CONFIG_OF' block, otherwise the compiler won't find 'keyboard_led_of_match' when CONFIG_OF isn't set.