]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cosmetic: atcpit100_timer: Use device api to get platdata
authorRick Chen <rickchen36@gmail.com>
Tue, 28 Nov 2017 01:14:20 +0000 (09:14 +0800)
committerRick Chen <rickchen36@gmail.com>
Thu, 30 Nov 2017 01:39:07 +0000 (09:39 +0800)
Use dev_get_platdata to get private platdata.

Signed-off-by: rick <rick@andestech.com>
Signed-off-by: Rick Chen <rickchen36@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/timer/atcpit100_timer.c

index d5146ddfa41b044281a43d340eedd0d3f4c2902a..963f978d206f94507bb95fa19799621e01a39782 100644 (file)
@@ -73,7 +73,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 +82,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);