summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/fsl_soc.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-10-29 16:29:04 +0200
committerScott Wood <oss@buserror.net>2016-11-23 01:23:37 -0600
commit0f236988e9ec13d0ee49f580f945d594bd7989a7 (patch)
tree2abf752f7a982638d434b6ce2c99ea605f48801b /arch/powerpc/sysdev/fsl_soc.c
parent47a48a92102b7e5a33356f87ca1b4873d2fce2f1 (diff)
downloadtalos-obmc-linux-0f236988e9ec13d0ee49f580f945d594bd7989a7.tar.gz
talos-obmc-linux-0f236988e9ec13d0ee49f580f945d594bd7989a7.zip
powerpc/fsl_soc: improve and simplify get_baudrate
Use of_property_read_u32 instead of the generic of_get_property to simplify the code. In addition move the declaration of fs_baudrate into get_baudrate because it's private to this function. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'arch/powerpc/sysdev/fsl_soc.c')
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index ebccf0bad4a1..19101f9cfcfc 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -136,10 +136,9 @@ u32 get_brgfreq(void)
EXPORT_SYMBOL(get_brgfreq);
-static u32 fs_baudrate = -1;
-
u32 get_baudrate(void)
{
+ static u32 fs_baudrate = -1;
struct device_node *node;
if (fs_baudrate != -1)
@@ -147,12 +146,7 @@ u32 get_baudrate(void)
node = of_find_node_by_type(NULL, "serial");
if (node) {
- int size;
- const unsigned int *prop = of_get_property(node,
- "current-speed", &size);
-
- if (prop)
- fs_baudrate = *prop;
+ of_property_read_u32(node, "current-speed", &fs_baudrate);
of_node_put(node);
}
OpenPOWER on IntegriCloud