Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp569050pxb; Tue, 15 Feb 2022 22:22:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwv0oEnDI6BMGm5eO1wfz8GGdcFx+ivsRlLKD7EiTt3+EY0x/5NugjUU56q9Od5Yh3oSCxd X-Received: by 2002:a17:902:9898:b0:14f:18b7:f04a with SMTP id s24-20020a170902989800b0014f18b7f04amr906522plp.127.1644992574659; Tue, 15 Feb 2022 22:22:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644992574; cv=none; d=google.com; s=arc-20160816; b=cq8HjsymRKxaKWVrLqYCLry13tgLlZmdDftLodFELUF2NNyB8hZeUiYCPGfrza3A5X yaU6V8Fb52myRkVmMfpE1E1TK1P0TcMKhTWOY3HdEGLNdu2EboS41B0cZqbdc2EpuYaF 16y0qK72f4gg8cCcZKbSRqkJXSsD2OKC8Vn9I3uCDHa8MiVPha5+z962FFfv9rG9KjDL A89zv1rwT6Ac8XcFqDKeeKKtzL0a/j3vCHWNQ05cgwd/UogqYl/cAEXq01J3EhRKON3R DsB9KuftQNI9rWk5YAdeROceyEUUJL2FvwfsfkbP9bSWuwyENs4ALNWMhviW0xDT4Udg ijJw== 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=tMSwIfjOv1Uyh0Rn8c3FPvnNt2awh1M6+sjpagFNNPs=; b=KiTrLWjBvNzEzk0XHkMZ3wZWesUliRyR70KsbPkT0NHt/u8eeczeUIPv3fnrKf+Ozw 2Rbd7FjCzCumLs5ZkWbSnXPVNLx6dc7enCm6HqcQDWZ1YWy5Rgl4mH2gVUppPJeGJRCF Bb+mvIdCM7Ju/xQ/e08O7gvB2sL8cIrAzd/bO0ACwhpYhT+/sg1qOGgQnp7nCX6zJs9O 0+wx3Op7wi3rX0LDV3eJd5uC8q23y/4ttfJFTtZM8/Sm0nQ2ZdEfcWprex63BhAyTjXZ xlOeq3T6cLH98/CFsaDzNXQrw4mFDm6pEBXvfC6BDqX5LzYsevVKB/zCy3l7FtINimiW 7rBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MrvjeIXC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n6si6828261plh.373.2022.02.15.22.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:22:54 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MrvjeIXC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D780B1A276D; Tue, 15 Feb 2022 22:20:49 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343748AbiBPCbu (ORCPT + 99 others); Tue, 15 Feb 2022 21:31:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236576AbiBPCbr (ORCPT ); Tue, 15 Feb 2022 21:31:47 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C6A5996BE for ; Tue, 15 Feb 2022 18:31:36 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id w20so863103plq.12 for ; Tue, 15 Feb 2022 18:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tMSwIfjOv1Uyh0Rn8c3FPvnNt2awh1M6+sjpagFNNPs=; b=MrvjeIXCQ0Ol/ZNcfXLD9ryra3Lxo0LuahOeXNhhVa8XVLk1mUyCn13YOkRJMEu7rU /IiaUHNDr77cLli/X5P8Akq/dF6VCwimLY3cWD9peCVXcnFV56IY9C7gNqaju6Y/YLy3 eWTGx5T7KUECG4JNaraqfYDi4uVSFg/kF5Iv+0n6BeHzpnTgQ2e9eIrsYZF3XfWZ3GhB WuEwHitGwU6yPS5Z7i9bu7dfGGKty0EU7dChAqeZ/QpqjScnH0TkUWB4Mm5UyxLYNufD qI3yU6sUDxkiD/3h9BfUlAfCRDkDWa7tEV0xEIg4ifAS6TMM+5ZGqlOi2GdVTXx1/dcO Nq9Q== 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=tMSwIfjOv1Uyh0Rn8c3FPvnNt2awh1M6+sjpagFNNPs=; b=KxVm97Gs7UDNlE9rEWhjjZJh7wgzL1qPM+rSTSC1DOjeVy786OB/QcH1rVMJ9cgraB G/Ecs0Q5K7JQa243Qr1I3VeySo3glVO9DJ6htqoh6+FGhbKWfRIdGoihNIhQSdkzOUYT Jx5IKMCACB7rRB3MKuVJGCUN17lbj8Zg3WiOPgtVEotE6ytxjkYQlTGajsyfi4RHpa9T QGeCfsvTgyzXuFfxPreJ4m6xbn8RNbLMis5OAOnEuJMHWbNnWrslN6DR1EopoX68WxDS xccqdDnN0hruq4fn6c0D2phxXU3uf3Rv31G6MQ8OU++nKBZMr79eKJ4y9Eiiy0tClNs/ L+qA== X-Gm-Message-State: AOAM532vZK6G/w67lgKuGP5jwnbC7znkg5HARqCxQfxjd/KlRRecDCii 6DiTAg69ToitCREy02t6V4DHTw== X-Received: by 2002:a17:902:82c7:b0:14f:252d:67e7 with SMTP id u7-20020a17090282c700b0014f252d67e7mr777069plz.27.1644978695666; Tue, 15 Feb 2022 18:31:35 -0800 (PST) Received: from google.com ([2401:fa00:1:10:adf7:46e7:cef5:ba49]) by smtp.gmail.com with ESMTPSA id 7sm18442035pjo.45.2022.02.15.18.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 18:31:35 -0800 (PST) Date: Wed, 16 Feb 2022 10:31:32 +0800 From: Tzung-Bi Shih To: Prashant Malani Cc: bleung@chromium.org, groeck@chromium.org, robh+dt@kernel.org, chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] platform/chrome: cros_kbd_led_backlight: support OF match Message-ID: References: <20220214053646.3088298-1-tzungbi@google.com> <20220214053646.3088298-5-tzungbi@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Tue, Feb 15, 2022 at 05:10:04PM -0800, Prashant Malani wrote: > On Sun, Feb 13, 2022 at 9:37 PM Tzung-Bi Shih wrote: > > diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c > > index 814f2b74c602..ba853e55d29a 100644 > > --- a/drivers/platform/chrome/cros_kbd_led_backlight.c > > +++ b/drivers/platform/chrome/cros_kbd_led_backlight.c > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > > > @@ -128,8 +129,11 @@ static int keyboard_led_probe(struct platform_device *pdev) > > int error; > > > > drvdata = acpi_device_get_match_data(&pdev->dev); > > - if (!drvdata) > > - return -EINVAL; > > + if (!drvdata) { > > + drvdata = of_device_get_match_data(&pdev->dev); > > + if (!drvdata) > > + return -EINVAL; > > + } > > I'm not familiar with this driver, so can't do a full review, but > shouldn't device_get_match_data() > from property.h [1] be able to handle both DT and ACPI cases? > > [1]: https://elixir.bootlin.com/linux/v5.17-rc4/source/include/linux/property.h Yes, it does[2][3]. Thanks for the feedback, will fix it in next version. [2]: https://elixir.bootlin.com/linux/v5.17-rc4/source/drivers/of/property.c#L1474 [3]: https://elixir.bootlin.com/linux/v5.17-rc4/source/drivers/acpi/property.c#L1386