Skip to content

Commit 7c4b497

Browse files
Bartosz Golaszewskibebarino
authored andcommitted
clk: davinci: remove platform data struct
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> Link: https://lore.kernel.org/r/20241217174154.84441-1-brgl@bgdev.pl Reviewed-by: David Lechner <david@lechnology.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 28fa329 commit 7c4b497

File tree

2 files changed

+3
-50
lines changed

2 files changed

+3
-50
lines changed

drivers/clk/davinci/pll.c

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/mfd/syscon.h>
2020
#include <linux/notifier.h>
2121
#include <linux/of.h>
22-
#include <linux/platform_data/clk-davinci-pll.h>
2322
#include <linux/platform_device.h>
2423
#include <linux/property.h>
2524
#include <linux/regmap.h>
@@ -840,27 +839,6 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,
840839
return 0;
841840
}
842841

843-
static struct davinci_pll_platform_data *davinci_pll_get_pdata(struct device *dev)
844-
{
845-
struct davinci_pll_platform_data *pdata = dev_get_platdata(dev);
846-
847-
/*
848-
* Platform data is optional, so allocate a new struct if one was not
849-
* provided. For device tree, this will always be the case.
850-
*/
851-
if (!pdata)
852-
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
853-
if (!pdata)
854-
return NULL;
855-
856-
/* for device tree, we need to fill in the struct */
857-
if (dev->of_node)
858-
pdata->cfgchip =
859-
syscon_regmap_lookup_by_compatible("ti,da830-cfgchip");
860-
861-
return pdata;
862-
}
863-
864842
/* needed in early boot for clocksource/clockevent */
865843
#ifdef CONFIG_ARCH_DAVINCI_DA850
866844
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,
890868
static int davinci_pll_probe(struct platform_device *pdev)
891869
{
892870
struct device *dev = &pdev->dev;
893-
struct davinci_pll_platform_data *pdata;
894871
davinci_pll_init pll_init = NULL;
872+
struct regmap *cfgchip;
895873
void __iomem *base;
896874

897875
pll_init = device_get_match_data(dev);
@@ -903,17 +881,13 @@ static int davinci_pll_probe(struct platform_device *pdev)
903881
return -EINVAL;
904882
}
905883

906-
pdata = davinci_pll_get_pdata(dev);
907-
if (!pdata) {
908-
dev_err(dev, "missing platform data\n");
909-
return -EINVAL;
910-
}
884+
cfgchip = syscon_regmap_lookup_by_compatible("ti,da830-cfgchip");
911885

912886
base = devm_platform_ioremap_resource(pdev, 0);
913887
if (IS_ERR(base))
914888
return PTR_ERR(base);
915889

916-
return pll_init(dev, base, pdata->cfgchip);
890+
return pll_init(dev, base, cfgchip);
917891
}
918892

919893
static struct platform_driver davinci_pll_driver = {

include/linux/platform_data/clk-davinci-pll.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)