Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Bartosz Golaszewski and committed by
Stephen Boyd
7c4b497f 28fa3291

+3 -50
+3 -29
drivers/clk/davinci/pll.c
··· 19 19 #include <linux/mfd/syscon.h> 20 20 #include <linux/notifier.h> 21 21 #include <linux/of.h> 22 - #include <linux/platform_data/clk-davinci-pll.h> 23 22 #include <linux/platform_device.h> 24 23 #include <linux/property.h> 25 24 #include <linux/regmap.h> ··· 839 840 return 0; 840 841 } 841 842 842 - static struct davinci_pll_platform_data *davinci_pll_get_pdata(struct device *dev) 843 - { 844 - struct davinci_pll_platform_data *pdata = dev_get_platdata(dev); 845 - 846 - /* 847 - * Platform data is optional, so allocate a new struct if one was not 848 - * provided. For device tree, this will always be the case. 849 - */ 850 - if (!pdata) 851 - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); 852 - if (!pdata) 853 - return NULL; 854 - 855 - /* for device tree, we need to fill in the struct */ 856 - if (dev->of_node) 857 - pdata->cfgchip = 858 - syscon_regmap_lookup_by_compatible("ti,da830-cfgchip"); 859 - 860 - return pdata; 861 - } 862 - 863 843 /* needed in early boot for clocksource/clockevent */ 864 844 #ifdef CONFIG_ARCH_DAVINCI_DA850 865 845 CLK_OF_DECLARE(da850_pll0, "ti,da850-pll0", of_da850_pll0_init); ··· 868 890 static int davinci_pll_probe(struct platform_device *pdev) 869 891 { 870 892 struct device *dev = &pdev->dev; 871 - struct davinci_pll_platform_data *pdata; 872 893 davinci_pll_init pll_init = NULL; 894 + struct regmap *cfgchip; 873 895 void __iomem *base; 874 896 875 897 pll_init = device_get_match_data(dev); ··· 881 903 return -EINVAL; 882 904 } 883 905 884 - pdata = davinci_pll_get_pdata(dev); 885 - if (!pdata) { 886 - dev_err(dev, "missing platform data\n"); 887 - return -EINVAL; 888 - } 906 + cfgchip = syscon_regmap_lookup_by_compatible("ti,da830-cfgchip"); 889 907 890 908 base = devm_platform_ioremap_resource(pdev, 0); 891 909 if (IS_ERR(base)) 892 910 return PTR_ERR(base); 893 911 894 - return pll_init(dev, base, pdata->cfgchip); 912 + return pll_init(dev, base, cfgchip); 895 913 } 896 914 897 915 static struct platform_driver davinci_pll_driver = {
-21
include/linux/platform_data/clk-davinci-pll.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * PLL clock driver for TI Davinci SoCs 4 - * 5 - * Copyright (C) 2018 David Lechner <david@lechnology.com> 6 - */ 7 - 8 - #ifndef __LINUX_PLATFORM_DATA_CLK_DAVINCI_PLL_H__ 9 - #define __LINUX_PLATFORM_DATA_CLK_DAVINCI_PLL_H__ 10 - 11 - #include <linux/regmap.h> 12 - 13 - /** 14 - * davinci_pll_platform_data 15 - * @cfgchip: CFGCHIP syscon regmap 16 - */ 17 - struct davinci_pll_platform_data { 18 - struct regmap *cfgchip; 19 - }; 20 - 21 - #endif /* __LINUX_PLATFORM_DATA_CLK_DAVINCI_PLL_H__ */