summaryrefslogtreecommitdiff
path: root/drivers/clk/samsung/clk-s3c2410-dclk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/samsung/clk-s3c2410-dclk.c')
-rw-r--r--drivers/clk/samsung/clk-s3c2410-dclk.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c
index 077df3e539a7..0d92f3e5e3d9 100644
--- a/drivers/clk/samsung/clk-s3c2410-dclk.c
+++ b/drivers/clk/samsung/clk-s3c2410-dclk.c
@@ -219,8 +219,7 @@ static int s3c24xx_dclk1_div_notify(struct notifier_block *nb,
#ifdef CONFIG_PM_SLEEP
static int s3c24xx_dclk_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct s3c24xx_dclk *s3c24xx_dclk = platform_get_drvdata(pdev);
+ struct s3c24xx_dclk *s3c24xx_dclk = dev_get_drvdata(dev);
s3c24xx_dclk->reg_save = readl_relaxed(s3c24xx_dclk->base);
return 0;
@@ -228,8 +227,7 @@ static int s3c24xx_dclk_suspend(struct device *dev)
static int s3c24xx_dclk_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct s3c24xx_dclk *s3c24xx_dclk = platform_get_drvdata(pdev);
+ struct s3c24xx_dclk *s3c24xx_dclk = dev_get_drvdata(dev);
writel_relaxed(s3c24xx_dclk->reg_save, s3c24xx_dclk->base);
return 0;
@@ -247,9 +245,10 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev)
struct clk_hw **clk_table;
int ret, i;
- s3c24xx_dclk = devm_kzalloc(&pdev->dev, sizeof(*s3c24xx_dclk) +
- sizeof(*s3c24xx_dclk->clk_data.hws) * DCLK_MAX_CLKS,
- GFP_KERNEL);
+ s3c24xx_dclk = devm_kzalloc(&pdev->dev,
+ struct_size(s3c24xx_dclk, clk_data.hws,
+ DCLK_MAX_CLKS),
+ GFP_KERNEL);
if (!s3c24xx_dclk)
return -ENOMEM;