diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-06 21:20:23 +0300 |
---|---|---|
committer | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-19 21:58:10 +0300 |
commit | b84e23f5135103c45022b0e4a4ed2459d5398a7e (patch) | |
tree | b41da5da053dc35944de8fec10c83468cbb13aa9 /arch/arm/mach-s3c24xx | |
parent | 346f183cc1348cbf3814796afab0ea34475152a9 (diff) | |
download | linux-b84e23f5135103c45022b0e4a4ed2459d5398a7e.tar.xz |
ARM: s3c24xx: pass pointer to clk driver via platform data
Passing pointers directly as platform data is fragile and undocumented.
Better to create a platform data structure which explicitly documents
what is passed to the driver.
Suggested-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-6-krzk@kernel.org
Diffstat (limited to 'arch/arm/mach-s3c24xx')
-rw-r--r-- | arch/arm/mach-s3c24xx/common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index 222238e8acbb..c476a673d07f 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -17,6 +17,7 @@ #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/io.h> +#include <linux/platform_data/clk-s3c2410.h> #include <linux/platform_data/dma-s3c24xx.h> #include <linux/dmaengine.h> #include <linux/clk/samsung.h> @@ -663,13 +664,17 @@ static struct resource s3c2410_dclk_resource[] = { [0] = DEFINE_RES_MEM(0x56000084, 0x4), }; +static struct s3c2410_clk_platform_data s3c_clk_platform_data = { + .modify_misccr = s3c2410_modify_misccr, +}; + struct platform_device s3c2410_device_dclk = { .name = "s3c2410-dclk", .id = 0, .num_resources = ARRAY_SIZE(s3c2410_dclk_resource), .resource = s3c2410_dclk_resource, .dev = { - .platform_data = s3c2410_modify_misccr, + .platform_data = &s3c_clk_platform_data, }, }; #endif |