[REFACTOR] energy: move read_val()
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 17 Oct 2013 18:23:26 +0000 (22:23 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 17 Oct 2013 18:48:29 +0000 (22:48 +0400)
move:
energy/lcd/s6e8aa0.c --> energy/lcd/lcd_base.c

Change-Id: I8ff66df899d429cbfaeba2b10dbc2c60ce8c11bf
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
energy/lcd/lcd_base.c
energy/lcd/lcd_base.h
energy/lcd/s6e8aa0.c

index 88f2e37..1e5d1b1 100644 (file)
 
 
 #include <linux/module.h>
+#include <linux/fs.h>
 #include "lcd_base.h"
 
 
+int read_val(const char *path)
+{
+       int ret;
+       struct file *f;
+       unsigned long val;
+       char buf[32];
+
+       f = filp_open(path, O_RDONLY, 0);
+       if (IS_ERR(f)) {
+               printk("cannot open file \'%s\'", path);
+               return PTR_ERR(f);
+       }
+
+       ret = kernel_read(f, 0, buf, sizeof(buf));
+       filp_close(f, NULL);
+       if (ret < 0)
+               return ret;
+
+       ret = strict_strtoul(buf, 0, &val);
+       if (ret)
+               return ret;
+
+       return (int)val;
+}
+
 void set_backlight(int val)
 {
        /* TODO: implement */
index 8b59c56..4f4ec56 100644 (file)
@@ -52,6 +52,7 @@ void lcd_mach_exit(void)
 }
 #endif /* CONFIG_ENEGRGY_LCD */
 
+int read_val(const char *path);
 int lcd_init(void);
 void lcd_exit(void);
 
index 4e666c5..432b74a 100644 (file)
@@ -4,32 +4,6 @@
 static struct lcd_ops_set *ops_s = NULL;
 
 
-static int read_val(const char *path)
-{
-       int ret;
-       struct file *f;
-       unsigned long val;
-       char buf[32];
-
-       f = filp_open(path, O_RDONLY, 0);
-       if (IS_ERR(f)) {
-               printk("cannot open file \'%s\'", path);
-               return PTR_ERR(f);
-       }
-
-       ret = kernel_read(f, 0, buf, sizeof(buf));
-       filp_close(f, NULL);
-       if (ret < 0)
-               return ret;
-
-       ret = strict_strtoul(buf, 0, &val);
-       if (ret)
-               return ret;
-
-       return (int)val;
-}
-
-