From nobody Fri Jan 2 17:31:31 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D33C7CD611A for ; Mon, 9 Oct 2023 17:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378134AbjJIRdU (ORCPT ); Mon, 9 Oct 2023 13:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378136AbjJIRdB (ORCPT ); Mon, 9 Oct 2023 13:33:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5797AF; Mon, 9 Oct 2023 10:32:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8964C433C7; Mon, 9 Oct 2023 17:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696872776; bh=bD811IgL0XahLtC2Pif9I+JwkjBeOZFPqh5qFzCRf2c=; h=From:To:Cc:Subject:Date:From; b=qVg2iUt6vREdwmAre4ElvI0A0VeTwh07kCIrc+4DaZQONQosglU55G6RQrMNPBggN GPdlmJu+aO00tJ3ZkQ3XTlvpf+WubIkbBVjzYRa/ZvN4/JdM5sFu6jl5syjrpPLAVG 2NhfCMWFBij149icxxGt8QCoYiahbif3R1M0c7hhBygnGEFneb1sJe/SbZ7CcX53qZ U7V7ExfjKeqMAOQN5zs7h1Pr9JnpRapgLbxgzsPVMAG+2vVzd58eOgM9mZ5yhbk9Pz lhlmqiqU7Ot1ANmlZvyFElRSFiaFgy7XRSR1WfjxM+WqrtbBSkDQt8BjfnnF8hMlhH 2PT5nAr+i/GQA== Received: (nullmailer pid 2534592 invoked by uid 1000); Mon, 09 Oct 2023 17:32:54 -0000 From: Rob Herring To: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Heiko Stuebner Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH] pwm: Use device_get_match_data() Date: Mon, 9 Oct 2023 12:29:16 -0500 Message-ID: <20231009172923.2457844-21-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/pwm/pwm-img.c | 8 ++------ drivers/pwm/pwm-rockchip.c | 9 ++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c index 326af85888e7..e32b5e8c203d 100644 --- a/drivers/pwm/pwm-img.c +++ b/drivers/pwm/pwm-img.c @@ -13,9 +13,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -261,7 +261,6 @@ static int img_pwm_probe(struct platform_device *pdev) u64 val; unsigned long clk_rate; struct img_pwm_chip *imgchip; - const struct of_device_id *of_dev_id; =20 imgchip =3D devm_kzalloc(&pdev->dev, sizeof(*imgchip), GFP_KERNEL); if (!imgchip) @@ -273,10 +272,7 @@ static int img_pwm_probe(struct platform_device *pdev) if (IS_ERR(imgchip->base)) return PTR_ERR(imgchip->base); =20 - of_dev_id =3D of_match_device(img_pwm_of_match, &pdev->dev); - if (!of_dev_id) - return -ENODEV; - imgchip->data =3D of_dev_id->data; + imgchip->data =3D device_get_match_data(&pdev->dev); =20 imgchip->periph_regs =3D syscon_regmap_lookup_by_phandle(pdev->dev.of_nod= e, "img,cr-periph"); diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index 03ee18fb82d5..339165ef1f07 100644 --- a/drivers/pwm/pwm-rockchip.c +++ b/drivers/pwm/pwm-rockchip.c @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #include #include =20 @@ -297,16 +297,11 @@ MODULE_DEVICE_TABLE(of, rockchip_pwm_dt_ids); =20 static int rockchip_pwm_probe(struct platform_device *pdev) { - const struct of_device_id *id; struct rockchip_pwm_chip *pc; u32 enable_conf, ctrl; bool enabled; int ret, count; =20 - id =3D of_match_device(rockchip_pwm_dt_ids, &pdev->dev); - if (!id) - return -EINVAL; - pc =3D devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL); if (!pc) return -ENOMEM; @@ -345,7 +340,7 @@ static int rockchip_pwm_probe(struct platform_device *p= dev) =20 platform_set_drvdata(pdev, pc); =20 - pc->data =3D id->data; + pc->data =3D device_get_match_data(&pdev->dev); pc->chip.dev =3D &pdev->dev; pc->chip.ops =3D &rockchip_pwm_ops; pc->chip.npwm =3D 1; --=20 2.42.0