From: David Lechner <david@lechnology.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH] clk: davinci: remove platform data struct
Date: Mon, 16 Dec 2024 14:29:39 -0600 [thread overview]
Message-ID: <24fb0bdb-6d59-424e-bb8f-a9d54d835f4b@lechnology.com> (raw)
In-Reply-To: <20241210175723.127594-1-brgl@bgdev.pl>
On 12/10/24 11:57 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> There are no board files using struct davinci_pll_platform_data anymore.
> The structure itself is currently used to store a single pointer. Let's
> remove the struct definition, the header and rework the driver to not
> require the syscon regmap to be stored in probe().
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> drivers/clk/davinci/pll.c | 33 +++----------------
> include/linux/platform_data/clk-davinci-pll.h | 21 ------------
> 2 files changed, 4 insertions(+), 50 deletions(-)
> delete mode 100644 include/linux/platform_data/clk-davinci-pll.h
>
> diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c
> index 5bbbb3a66477..b284da602f8d 100644
> --- a/drivers/clk/davinci/pll.c
> +++ b/drivers/clk/davinci/pll.c
> @@ -19,7 +19,6 @@
> #include <linux/mfd/syscon.h>
> #include <linux/notifier.h>
> #include <linux/of.h>
> -#include <linux/platform_data/clk-davinci-pll.h>
> #include <linux/platform_device.h>
> #include <linux/property.h>
> #include <linux/regmap.h>
> @@ -840,27 +839,6 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,
> return 0;
> }
>
> -static struct davinci_pll_platform_data *davinci_pll_get_pdata(struct device *dev)
> -{
> - struct davinci_pll_platform_data *pdata = dev_get_platdata(dev);
> -
> - /*
> - * Platform data is optional, so allocate a new struct if one was not
> - * provided. For device tree, this will always be the case.
> - */
> - if (!pdata)
> - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> - if (!pdata)
> - return NULL;
> -
> - /* for device tree, we need to fill in the struct */
> - if (dev->of_node)
> - pdata->cfgchip =
> - syscon_regmap_lookup_by_compatible("ti,da830-cfgchip");
> -
> - return pdata;
> -}
> -
> /* needed in early boot for clocksource/clockevent */
> #ifdef CONFIG_ARCH_DAVINCI_DA850
> CLK_OF_DECLARE(da850_pll0, "ti,da850-pll0", of_da850_pll0_init);
> @@ -890,8 +868,8 @@ typedef int (*davinci_pll_init)(struct device *dev, void __iomem *base,
> static int davinci_pll_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - struct davinci_pll_platform_data *pdata;
> davinci_pll_init pll_init = NULL;
> + struct regmap *cfgchip;
I think we need to initialize this to NULL since it is only set
conditionally later.
> void __iomem *base;
>
> pll_init = device_get_match_data(dev);
> @@ -903,17 +881,14 @@ static int davinci_pll_probe(struct platform_device *pdev)
> return -EINVAL;
> }
>
> - pdata = davinci_pll_get_pdata(dev);
> - if (!pdata) {
> - dev_err(dev, "missing platform data\n");
> - return -EINVAL;
> - }
> + if (dev->of_node)
Or just leave out the if here.
> + cfgchip = syscon_regmap_lookup_by_compatible("ti,da830-cfgchip");
>
> base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(base))
> return PTR_ERR(base);
>
> - return pll_init(dev, base, pdata->cfgchip);
> + return pll_init(dev, base, cfgchip);
> }
>
next prev parent reply other threads:[~2024-12-16 20:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 17:57 [PATCH] clk: davinci: remove platform data struct Bartosz Golaszewski
2024-12-16 20:29 ` David Lechner [this message]
2024-12-17 17:31 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=24fb0bdb-6d59-424e-bb8f-a9d54d835f4b@lechnology.com \
--to=david@lechnology.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox