Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp681710rdb; Fri, 6 Oct 2023 15:59:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGk/aY914SPL0ZK2rFlVP1ZwInI/I4hjgL7BAV9UL+J8RbYCIwyjN45woMdlaounMCPvkHK X-Received: by 2002:a17:902:ed54:b0:1c2:eac:b99 with SMTP id y20-20020a170902ed5400b001c20eac0b99mr9282644plb.40.1696633143959; Fri, 06 Oct 2023 15:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696633143; cv=none; d=google.com; s=arc-20160816; b=Q8w+rvdQFpHXx9fLNUehlTdZTldqbT68uOd23p3PtGFqGGVOhx2asepL3EuyMkZA9J gGQDRukL8o4Eoug/gz1vI6OdBfP81l8WOA33j6LcPZFllTm7Cw+TyfAokdZGGU7xa4yW 05spBmXUMUInWaJo4JIjUm3ke1ZKiRp+EewRPAidu8fDHbTqKrscjU8PcY4KboMLPXEw UKh1WmXilIfbZRgT8z/R+jn1Yn0bb1QOMecW+OTkqt+zZnwP3E3UBBRLn6gUKklMoHIt cwQQ5TYVWHMjO0pcUAYO1oOWRBWsPBgNit5c8w4sv9sNw+quBrFZWn5DCuNyawvlMBjd u86g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Cn2N0+hC1iWxUYEh8kTcCLVKqtUo/VhlfF7+IEsCtBM=; fh=OZXb7NC8LXl85SNKiwSPHb7vwfrKeXLYqBXAjNGZSG0=; b=ufB2gIDYpXF1Hw3rxJaZ4iKXFo3LUvft8GWfsppTk51grUfXZq+KLRS7fYZ9p0Lygw uoB4PQ40l9jrKYpUho/YUo0I1TeSci+KgC/zKOloeR/jrJ4hpi8Knfx2yBHOnwXRLtoB Agf8Y46wYSJ7GMuG0/kD5V7PV9MZmd3F1nUAq6vqbOBYunP0jF4ZwHqEhBNsuzh2jnwg IsF/VUA7olMU5Xa8QBsQQ1pN7JzM1dw+CdS3MSVDRHqSgdA/UnLLh3uMbu1WY+hytKWu XBFuG5fmmO6NL1gecDdwqj8B8rdjb4zKSLLSi5tevtGM58vIOnDvQIrnqiESMf4B4GFq Obsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rcV3x9OF; 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id x5-20020a170902ec8500b001c0c79b3869si5034607plg.578.2023.10.06.15.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:59:03 -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=rcV3x9OF; 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 CA0428211412; Fri, 6 Oct 2023 15:59:01 -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 S233807AbjJFW6u (ORCPT + 99 others); Fri, 6 Oct 2023 18:58:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233568AbjJFW6t (ORCPT ); Fri, 6 Oct 2023 18:58:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA24FAD; Fri, 6 Oct 2023 15:58:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8007AC433CB; Fri, 6 Oct 2023 22:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696633127; bh=VfpPsL7bm6HmerXk75YQFSWmkvZ5EqPcTozDyLPJ7ZE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rcV3x9OFyzgcq5JnKP7XyajjlUizbG7zv6TwJX1iaKrCN8FqIuecH1Zs6kZmhQOEZ P5swnL8g91dfdtAH5uD7CUPfp58B/0YpSIN3ixWWJxQCviyKPUkQq+hsY1llVzxYks n7hsv2wXXYKbSOT/lGjFXr+QCVT1bYxu2KJgb8h/w4I/W4nHsezboD2QmBMGg+JS+c fddknGRh0stdSH0IZPgrnL/3usGUh990pEG/HYNmtGfKnUEX0brB5XNw5LeEfdwL77 yiA6xNpKXtTYNHFZcFfGboeB8buBhEtSzb/U6IMxeUW700lfF9/6Pry8ADjWXuuya7 fqO4GAuHBxKnQ== Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5046bf37daeso3418245e87.1; Fri, 06 Oct 2023 15:58:47 -0700 (PDT) X-Gm-Message-State: AOJu0Yw9hyN/C7Rv7isqw8Eo8yOD44kYSejPdkCsbeZBGE3mti2mTbMY 9v4VE93KEOKvJaxutYldXTzHdTgu2LQOY4KHhQ== X-Received: by 2002:a19:6414:0:b0:4fb:8435:3efc with SMTP id y20-20020a196414000000b004fb84353efcmr7215825lfb.16.1696633125695; Fri, 06 Oct 2023 15:58:45 -0700 (PDT) MIME-Version: 1.0 References: <20231006213959.334439-1-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Fri, 6 Oct 2023 17:58:33 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] clk: Use device_get_match_data() To: Dmitry Baryshkov Cc: Charles Keepax , Richard Fitzgerald , Michael Turquette , Stephen Boyd , David Lechner , Sekhar Nori , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiko Stuebner , Krzysztof Kozlowski , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Alim Akhtar , Tero Kristo , patches@opensource.cirrus.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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]); Fri, 06 Oct 2023 15:59:01 -0700 (PDT) X-Spam-Level: ** On Fri, Oct 6, 2023 at 5:10=E2=80=AFPM Dmitry Baryshkov wrote: > > On Sat, 7 Oct 2023 at 00:41, Rob Herring wrote: > > > > 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/clk/clk-lochnagar.c | 9 ++------- > > drivers/clk/davinci/da8xx-cfgchip.c | 8 +++----- > > drivers/clk/davinci/pll.c | 10 +++------- > > drivers/clk/davinci/psc.c | 10 +++------- > > drivers/clk/qcom/gcc-msm8960.c | 13 +++++-------- > > drivers/clk/qcom/gcc-msm8974.c | 10 +++------- > > drivers/clk/qcom/kpss-xcc.c | 9 ++------- > > drivers/clk/qcom/krait-cc.c | 14 +++++--------- > > drivers/clk/qcom/mmcc-msm8960.c | 16 +++++----------- > > drivers/clk/qcom/mmcc-sdm660.c | 8 ++------ > > drivers/clk/rockchip/clk-rk3399.c | 9 ++------- > > drivers/clk/samsung/clk-exynos-clkout.c | 8 +++----- > > drivers/clk/ti/adpll.c | 14 ++++---------- > > 13 files changed, 42 insertions(+), 96 deletions(-) > > > > diff --git a/drivers/clk/qcom/mmcc-msm8960.c b/drivers/clk/qcom/mmcc-ms= m8960.c > > index 6bf908a51f53..50638ab341ec 100644 > > --- a/drivers/clk/qcom/mmcc-msm8960.c > > +++ b/drivers/clk/qcom/mmcc-msm8960.c > > @@ -8,9 +8,9 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > -#include > > #include > > #include > > #include > > @@ -3105,30 +3105,24 @@ MODULE_DEVICE_TABLE(of, mmcc_msm8960_match_tabl= e); > > > > static int mmcc_msm8960_probe(struct platform_device *pdev) > > { > > - const struct of_device_id *match; > > struct regmap *regmap; > > - bool is_8064; > > struct device *dev =3D &pdev->dev; > > + const struct qcom_cc_desc *desc =3D device_get_match_data(dev); > > > > - match =3D of_match_device(mmcc_msm8960_match_table, dev); > > - if (!match) > > - return -EINVAL; > > - > > - is_8064 =3D of_device_is_compatible(dev->of_node, "qcom,mmcc-ap= q8064"); > > Can we please keep of_device_is_compatible here? It is more explicit > and self-documenting. Why do we need to match 3 times (match, device_get_match_data, of_device_is_compatible)? Perhaps put it in the match data? Or make a helper function is_8064() that does the comparison to the match data? > Also, it would be really nice to have per-platform patches, so that > our maintainers can pick them, otherwise the risk of conflicts is > pretty high. No. I'm doing this treewide. It's already pretty unmanageable. But feel free to submit a separate patch if you prefer to this for QCom. When I split things up by sub-arch, then I also have to spend time chasing down non-responsive maintainers. Rob