Change-Id: I4bd20279239f9787a70d3c13534f0fd301cf705c
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
#include "debugfs_energy.h"
#include "rational_debugfs.h"
#include "lcd/lcd_debugfs.h"
+#include "lcd/lcd_base.h"
/* CPU running */
*/
void exit_debugfs_energy(void)
{
+ lcd_exit();
+ exit_lcd_debugfs();
+
if (energy_dir)
debugfs_remove_recursive(energy_dir);
goto fail;
}
+ if (init_lcd_debugfs(energy_dir))
+ goto fail;
+
+ /* Actually, the only goal of lcd_init() is to register lcd screen's
+ debugfs, so it is called here. */
+ if (lcd_init()) {
+ exit_lcd_debugfs();
+ goto fail;
+ }
+
return 0;
fail:
int ret;
ret = init_feature();
- if (ret) {
- printk(KERN_INFO "Cannot init feature\n");
- return ret;
- }
-
- ret = lcd_init();
if (ret)
- printk(KERN_INFO "Cannot init LCD, ret=%d\n", ret);
+ printk(KERN_INFO "Cannot init feature\n");
- return 0;
+ return ret;
}
/**
*/
void energy_uninit(void)
{
- lcd_exit();
uninit_feature();
if (energy_enable)
void lcd_exit(void)
{
do_lcd_exit();
- exit_lcd_debugfs();
}
static int do_lcd_init(void)
int lcd_init(void)
{
int ret;
- struct dentry *energy_dir;
-
- energy_dir = get_energy_dir();
- if (energy_dir == NULL) {
- printk(KERN_INFO "Cannot energy_dir\n");
- return -ENOENT;
- }
-
- ret = init_lcd_debugfs(energy_dir);
- if (ret)
- return ret;
ret = do_lcd_init();
- if (ret) {
+ if (ret)
printk(KERN_INFO "LCD is not supported\n");
- exit_lcd_debugfs();
- }
return ret;
}