X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Ftimer%2Fatmel_pit_timer.c;h=a0daf49dad226b94837de88a0f787ab7317b7688;hb=41575d8e4c334df148c4cdd7c40cc825dc0fcaa1;hp=009af2f9298c7c2172c17e68e11c4bf5fc58968e;hpb=1d6edcbfed2af33c748f2beb399810a0441888da;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/timer/atmel_pit_timer.c b/drivers/timer/atmel_pit_timer.c index 009af2f..a0daf49 100644 --- a/drivers/timer/atmel_pit_timer.c +++ b/drivers/timer/atmel_pit_timer.c @@ -9,6 +9,7 @@ #include #include #include +#include #define AT91_PIT_VALUE 0xfffff #define AT91_PIT_PITEN BIT(24) /* Timer Enabled */ @@ -24,15 +25,13 @@ struct atmel_pit_platdata { struct atmel_pit_regs *regs; }; -static int atmel_pit_get_count(struct udevice *dev, u64 *count) +static u64 atmel_pit_get_count(struct udevice *dev) { struct atmel_pit_platdata *plat = dev_get_platdata(dev); struct atmel_pit_regs *const regs = plat->regs; u32 val = readl(®s->value_image); - *count = timer_conv_64(val); - - return 0; + return timer_conv_64(val); } static int atmel_pit_probe(struct udevice *dev) @@ -63,7 +62,7 @@ static int atmel_pit_ofdata_to_platdata(struct udevice *dev) { struct atmel_pit_platdata *plat = dev_get_platdata(dev); - plat->regs = (struct atmel_pit_regs *)devfdt_get_addr_ptr(dev); + plat->regs = dev_read_addr_ptr(dev); return 0; } @@ -82,7 +81,7 @@ U_BOOT_DRIVER(atmel_pit) = { .id = UCLASS_TIMER, .of_match = atmel_pit_ids, .ofdata_to_platdata = atmel_pit_ofdata_to_platdata, - .platdata_auto_alloc_size = sizeof(struct atmel_pit_platdata), + .platdata_auto = sizeof(struct atmel_pit_platdata), .probe = atmel_pit_probe, .ops = &atmel_pit_ops, };