Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp120311ioo; Wed, 25 May 2022 23:00:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAPN0msi9cfHUmAfD1mt67fu0M9YhR9xG4mzF7eX2PBzRdp5QEZf7lFcFMXYBXuatMN9Rb X-Received: by 2002:a17:90a:a393:b0:1d0:e448:811d with SMTP id x19-20020a17090aa39300b001d0e448811dmr898583pjp.97.1653544847622; Wed, 25 May 2022 23:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653544847; cv=none; d=google.com; s=arc-20160816; b=NPSfb+EFAS7erip0ATHGUoZ3q3zk+nj2ZMTgh+mcCHbAs/r3hxeHzUtQPMGNQr9JqR tThX6JzxNgJKf9e84+ooOKpHBuhhFNsTMbAqhopJifaYyq5zZ0U06C9SHSQzR1nyA4EO ox/km1vRb1GDfd1o/J7rU04bep4CoNiMPVdLN/T4ygfs0pv/45B9j2pdWakA5cWBfCab AUC0emOLWTMbmyaVQP7eVFw4jSES+UfEUdBBhz62MHFlmMyxSybAciZhoi2aHNIq4ymy sNtxyzgHzGjbikHWNhuM+J64nCLmYVPdWdOUfZ8rmvJwWAIK4oZwYtZiGP48mF0jkpgb 4hZg== 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=kcKV1w2nPlwaIbCWnEveE9hseS5PyiFCk/LlY1siP3E=; b=lbS0H6y7uttK4d2VUCRsSzmmM+St4UBAK19BDxdwQxDRUQEmAx/Imvjaa7QEeEtzjG OOSzDGYBB/LTlKuhVJtevWR1I04OWxN1Nal71njupQd8LDYLcK4OVsAYfi0CQhaXQnd7 PN9yCKfDEFMoQ18wV9lDX/dQ1VrqeY8OeUYMcKGyNmzGgyL7D6+wQ61KGHoDt/dRlbrZ SOE1nqi5BQACqlnFD7eJJupRIH14Rk/Uv1dRmQu7+Cro48O3CAz2imKoNmPRIItUhVdP pt6zRaKNGWRep1FsjzQfoTEB07HEl8ZkRhJ6HCKybZrplzAXw8qlNAhiBnxTMjuE8ykG CNSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gF4mzOT2; 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 s6-20020a632146000000b003fab4d65a2fsi1253998pgm.395.2022.05.25.23.00.36; Wed, 25 May 2022 23:00:47 -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=gF4mzOT2; 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 S241326AbiEYSk5 (ORCPT + 99 others); Wed, 25 May 2022 14:40:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbiEYSkz (ORCPT ); Wed, 25 May 2022 14:40:55 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D317EB2266 for ; Wed, 25 May 2022 11:40:54 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id q4so19302782plr.11 for ; Wed, 25 May 2022 11:40:54 -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=kcKV1w2nPlwaIbCWnEveE9hseS5PyiFCk/LlY1siP3E=; b=gF4mzOT2oM4CfPgmn1UlSGGEbwf+gvzsFyifnYVIbjNO0iu8sUlx7k25anA+q/KaOi 373snxdX0rBgwl3v9kDUgarArIHyNVdS6o43qZlRlc4EcZFit/EVrtVCsh1VFdW6f3hV 35T/ena+zbKsnIdkZeM9Mbe6e3JwSsSvQtZO0= 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=kcKV1w2nPlwaIbCWnEveE9hseS5PyiFCk/LlY1siP3E=; b=kuPCL+yOBjxqOCRk4RrKlQ4EajBmQUsDAEeBzIoXY5SHjH7W4qKcmdGWRTu4QTNQ1z Zw90J2tOrpgjQdzWI8kScJI7mrs3I15Ncz0aT0nbC3CrbPJgmz9F9gQbXg/KH7YLviDO jIQU1h1VM5y2jzpGnFzB7YKY9vW5Run/fxTo0QsS4Egaf6XPA2ligA+Ubk5kPsbbP7/C mY5LtJ8ZW5+92EI9aptbOmAgi/PdxX6fl4H6BRKci8br0YRyIan3WSS9yDmnJFFpGCCh FSvLHmMuzwXO5XdxMo/P//nuh//COl6IW2WytkceaSS3GVsq517k7TFbDrEX0CAsL6cO dvsg== X-Gm-Message-State: AOAM5334ZjCtUrY3aO9ShyraSi+nGdBJwnFCDIEXAJku+qCTxnKiBklk ee/++M+7gsl6TzEV7T2dwgzNhg== X-Received: by 2002:a17:903:2445:b0:161:d47e:88cf with SMTP id l5-20020a170903244500b00161d47e88cfmr33393332pls.67.1653504054374; Wed, 25 May 2022 11:40:54 -0700 (PDT) Received: from chromium.org (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id d1-20020a17090a8d8100b001df93c8e737sm2133845pjo.39.2022.05.25.11.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 11:40:53 -0700 (PDT) Date: Wed, 25 May 2022 18:40:52 +0000 From: Prashant Malani 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, mka@chromium.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=us-ascii 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 Hi Tzung-Bi, On May 23 17:08, 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 linux/of.h includes linux/property.h [1] [1] https://elixir.bootlin.com/linux/v5.18/source/include/linux/of.h#L22 > #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), > }, > .probe = keyboard_led_probe, > }; > -- > 2.36.1.124.g0e6072fb45-goog > >