Merge tag 'arc-more-updates-for-2018.11-rc2-2' of git://git.denx.de/u-boot-arc
[platform/kernel/u-boot.git] / drivers / timer / atcpit100_timer.c
index d5146dd..f650c1b 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Andestech ATCPIT100 timer driver
  *
  * (C) Copyright 2016
  * Rick Chen, NDS32 Software Engineering, rick@andestech.com
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <dm.h>
@@ -12,8 +11,6 @@
 #include <timer.h>
 #include <linux/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define REG32_TMR(x)   (*(u32 *)       ((plat->regs) + (x>>2)))
 
 /*
@@ -73,7 +70,7 @@ struct atcpit_timer_platdata {
 
 static int atcpit_timer_get_count(struct udevice *dev, u64 *count)
 {
-       struct atcpit_timer_platdata *plat = dev->platdata;
+       struct atcpit_timer_platdata *plat = dev_get_platdata(dev);
        u32 val;
        val = ~(REG32_TMR(CH_CNT(1))+0xffffffff);
        *count = timer_conv_64(val);
@@ -82,7 +79,7 @@ static int atcpit_timer_get_count(struct udevice *dev, u64 *count)
 
 static int atcpit_timer_probe(struct udevice *dev)
 {
-       struct atcpit_timer_platdata *plat = dev->platdata;
+       struct atcpit_timer_platdata *plat = dev_get_platdata(dev);
        REG32_TMR(CH_REL(1)) = 0xffffffff;
        REG32_TMR(CH_CTL(1)) = APB_CLK|TMR_32;
        REG32_TMR(CH_EN) |= CH_TMR_EN(1 , 0);