From patchwork Mon Oct 9 21:13:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 150330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2124373vqo; Mon, 9 Oct 2023 14:14:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsNP/Xi/PBCwXX5Un3YrNsP1Y95SMY4R7LO1gH53IiRKHQgEmeqhTjYy89E59BVxVW4s65 X-Received: by 2002:a17:902:c408:b0:1c5:f0fd:51b5 with SMTP id k8-20020a170902c40800b001c5f0fd51b5mr20734863plk.40.1696886067409; Mon, 09 Oct 2023 14:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696886067; cv=none; d=google.com; s=arc-20160816; b=UERMWMygSAXML7x6Xe9VeoLsZeiWkDbUVXi45FNx2sYwdAl3M64f4IUuwwAmbfOTlv AMaC1uLuDSyX82fAspMYhRFvbuPD68Pw6IKKjKEHutpRoHsONV2ZpN7w5sAHu61rr3ZJ eKPZ2zEgCjFBhSzLUG3rxjqdu/U5jxOU3Q/zG6GHrmQ6os9nFzUcoX5K7KLSHwzWcfZI Z+br/vyuTPrAAqLPmMwQBxvA4jxcpBe8vAvU0HXWiXS6V2kyVYljmg+IQpBm8Mcz6arF mCP9I9Eq2eSYuSOeeh/8spdxO67iQrCzsvzCjGWXVpWFJfYQxKogXOWwshu+l9JbyPQN 53WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RCg6f5/T02V1q5il/uuEVJCsez595XWmMuk/ZZxOjtI=; fh=SubvXZJN7EVhuhIEVVujNVZadt5rNFp0wHydOiwO6mA=; b=o4Xh5jC5Lr8KDyIGoqGuUZnCS4EDJiRqi6Xv8KM2SrA4SsrdVsJUHH5OPRjPgTZsHc AtJhEzD1AVX3lCDLIwVHzBym//nyTCEu421I6n9+1462an4d07fynjicL9l79Nk7xpAW z4pIubOTqWSbn1Y+XcRr2E2T4U+9TnbP50QrL0EWANHVjiIfShIlad0M7HLW4bAA8rd7 RArEzOk5VX+KwjbEeOMU8FS7rFUlCgyzlhZYm6wQEV7Pxntfiv89cpFSOzygUIIMb37W xUAdmuK/O1wrD7yvcLGHiEz6VYBc2BUMniPy2jwHE8EjnPl5LNwU4CSGmtzo3Pr8oAir 1Aqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OyH2jxz1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j3-20020a170903028300b001c1eed8a336si11115675plr.167.2023.10.09.14.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 14:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OyH2jxz1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8F5BA803112F; Mon, 9 Oct 2023 14:14:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378632AbjJIVOL (ORCPT + 19 others); Mon, 9 Oct 2023 17:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378151AbjJIVOK (ORCPT ); Mon, 9 Oct 2023 17:14:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAF6792; Mon, 9 Oct 2023 14:14:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C614AC433C7; Mon, 9 Oct 2023 21:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696886048; bh=QXfTbUIE2k0njqWEXV6u+Uau+22OTmsX1QDZDU0Eblo=; h=From:To:Cc:Subject:Date:From; b=OyH2jxz1nCo/jE1otcDSKiA6qL9gTi8SkQDl8sqMkn4hrCaRkJkH97HEw2mxNF5nd E/in8QtZc4lPIVbSsE2FNI2MyOegPEYXVOXC+bAERICmvR2ZaS/DSCqVlfRO4t9l8c TC4sC3AZDWJZh5AcU0m4vQUnycuQ3o55+8ia9+PxJPhAWvFEcIfiu/ivErcCFgfpo+ b4u+pmi0h7cffsZOHUkZAyriuiScusDCX3SQzE98bG5NgVA59saJx4ypvtTRo4AYWm 0vAqG/uU8D2Fk92FpGuOJNfjbZnp9R0C9WUBLCImQ99/eoz1TeSAvAsfaI3YyosfN2 KZ8FQVu8FybwA== Received: (nullmailer pid 3245125 invoked by uid 1000); Mon, 09 Oct 2023 21:14:06 -0000 From: Rob Herring To: Sean Young , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: ir-hix5hd2: Use device_get_match_data() Date: Mon, 9 Oct 2023 16:13:31 -0500 Message-ID: <20231009211356.3242037-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 14:14:22 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779314005317682643 X-GMAIL-MSGID: 1779314005317682643 Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring --- drivers/media/rc/ir-hix5hd2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c index 0034f615b466..de5bb9a08ea4 100644 --- a/drivers/media/rc/ir-hix5hd2.c +++ b/drivers/media/rc/ir-hix5hd2.c @@ -9,7 +9,9 @@ #include #include #include -#include +#include +#include +#include #include #include @@ -251,7 +253,6 @@ static int hix5hd2_ir_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct hix5hd2_ir_priv *priv; struct device_node *node = pdev->dev.of_node; - const struct of_device_id *of_id; const char *map_name; int ret; @@ -259,12 +260,11 @@ static int hix5hd2_ir_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - of_id = of_match_device(hix5hd2_ir_table, dev); - if (!of_id) { + priv->socdata = device_get_match_data(dev); + if (!priv->socdata) { dev_err(dev, "Unable to initialize IR data\n"); return -ENODEV; } - priv->socdata = of_id->data; priv->regmap = syscon_regmap_lookup_by_phandle(node, "hisilicon,power-syscon");