Loading drivers/base/regmap/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -62,3 +62,11 @@ config REGMAP_QTI_DEBUG interface to read and write a subset of regmap registers. This interface is more performant and easier to use than the traditional method which dumps all registers defined in a given regmap. config REGMAP_ALLOW_WRITE_DEBUGFS depends on REGMAP && DEBUG_FS bool "Allow REGMAP debugfs write" help Say 'y' here to allow the regmap debugfs write. Regmap debugfs write could be risky when accessing some essential hardwares, so it is not recommended to enable this option on any production device. drivers/base/regmap/regmap-debugfs.c +3 −4 Original line number Diff line number Diff line Loading @@ -288,8 +288,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf, count, ppos); } #define REGMAP_ALLOW_WRITE_DEBUGFS #ifdef REGMAP_ALLOW_WRITE_DEBUGFS #ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS /* * This can be dangerous especially when we have clients such as * PMICs, therefore don't provide any real compile time configuration option Loading Loading @@ -360,7 +359,7 @@ static ssize_t regmap_data_read_file(struct file *file, char __user *user_buf, new_count, ppos); } #ifdef REGMAP_ALLOW_WRITE_DEBUGFS #ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS static ssize_t regmap_data_write_file(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) Loading Loading @@ -661,7 +660,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name) if (map->max_register || regmap_readable(map, 0)) { umode_t registers_mode; #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) #ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS registers_mode = 0600; #else registers_mode = 0400; Loading Loading
drivers/base/regmap/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -62,3 +62,11 @@ config REGMAP_QTI_DEBUG interface to read and write a subset of regmap registers. This interface is more performant and easier to use than the traditional method which dumps all registers defined in a given regmap. config REGMAP_ALLOW_WRITE_DEBUGFS depends on REGMAP && DEBUG_FS bool "Allow REGMAP debugfs write" help Say 'y' here to allow the regmap debugfs write. Regmap debugfs write could be risky when accessing some essential hardwares, so it is not recommended to enable this option on any production device.
drivers/base/regmap/regmap-debugfs.c +3 −4 Original line number Diff line number Diff line Loading @@ -288,8 +288,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf, count, ppos); } #define REGMAP_ALLOW_WRITE_DEBUGFS #ifdef REGMAP_ALLOW_WRITE_DEBUGFS #ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS /* * This can be dangerous especially when we have clients such as * PMICs, therefore don't provide any real compile time configuration option Loading Loading @@ -360,7 +359,7 @@ static ssize_t regmap_data_read_file(struct file *file, char __user *user_buf, new_count, ppos); } #ifdef REGMAP_ALLOW_WRITE_DEBUGFS #ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS static ssize_t regmap_data_write_file(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) Loading Loading @@ -661,7 +660,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name) if (map->max_register || regmap_readable(map, 0)) { umode_t registers_mode; #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) #ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS registers_mode = 0600; #else registers_mode = 0400; Loading