summaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c24xx
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-06 20:20:23 +0200
committerKrzysztof Kozlowski <krzk@kernel.org>2020-08-19 20:58:10 +0200
commitb84e23f5135103c45022b0e4a4ed2459d5398a7e (patch)
treeb41da5da053dc35944de8fec10c83468cbb13aa9 /arch/arm/mach-s3c24xx
parent346f183cc1348cbf3814796afab0ea34475152a9 (diff)
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.c7
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