diff options
author | Paul Mackerras <paulus@samba.org> | 2006-09-19 00:06:27 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-09-20 01:09:48 -0400 |
commit | a4dc7ff08915a2035aa6d6decc53fa1deaa410bb (patch) | |
tree | 9b28af3a21f915e3fe8ed7ee163be1b1d2bfe8b0 /arch/powerpc/kernel/time.c | |
parent | 19e59df4dc2e6f7b46190ee77ce7093769f597a7 (diff) |
[POWERPC] Define of_read_ulong helper
There are various places where we want to extract an unsigned long
value from a device-tree property that can be 1 or 2 cells in length.
This replaces some open-coded calculations, and one place where we
assumed without checking that properties were the length we wanted,
with a little of_read_ulong() helper.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r-- | arch/powerpc/kernel/time.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index b9a2061cfdb..7a3c3f791ad 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -870,9 +870,7 @@ static int __init get_freq(char *name, int cells, unsigned long *val) | |||
870 | fp = get_property(cpu, name, NULL); | 870 | fp = get_property(cpu, name, NULL); |
871 | if (fp) { | 871 | if (fp) { |
872 | found = 1; | 872 | found = 1; |
873 | *val = 0; | 873 | *val = of_read_ulong(fp, cells); |
874 | while (cells--) | ||
875 | *val = (*val << 32) | *fp++; | ||
876 | } | 874 | } |
877 | 875 | ||
878 | of_node_put(cpu); | 876 | of_node_put(cpu); |