mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
regmap: Quit the read-loop based on position of file-offset
Some implementation's of the 'cat' command pass the absolute position of the file-offset. In the current implementation of 'regmap_data_read_file' this leads to dumping all the registers from offset 0. Avoid this by quitting the read loop if the file-offset requested is lower than actual read-offset. Change-Id: I7c6c31958e92f16387bf4cb5de7fbf4572fcce21 Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
This commit is contained in:
parent
90ae165d38
commit
40e7dc2fd6
1 changed files with 3 additions and 0 deletions
|
|
@ -355,6 +355,9 @@ static ssize_t regmap_data_read_file(struct file *file, char __user *user_buf,
|
|||
else if (*ppos >= map->dump_address * map->debugfs_tot_len
|
||||
+ map->dump_count * map->debugfs_tot_len)
|
||||
return 0;
|
||||
else if (*ppos < map->dump_address * map->debugfs_tot_len)
|
||||
return 0;
|
||||
|
||||
return regmap_read_debugfs(map, 0, map->max_register, user_buf,
|
||||
new_count, ppos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue