drivers: mfd: Avoid wcd9335 invalid register access

wcd9335 codec does not have registers from address
0xE00, but due to erroneous condition check, even
registers above 0xE00 are accessed in the driver.
Update condition so as to prevent the invalid register
access.

Change-Id: Iad3d1e72543c018ae102165f54b8a58f35994923
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
This commit is contained in:
Phani Kumar Uppalapati 2015-06-17 00:26:55 -07:00 committed by Gerrit - the friendly Code Review server
parent a90169e004
commit a1609b932e
1 changed files with 2 additions and 0 deletions

View File

@ -1300,6 +1300,8 @@ static bool wcd9335_is_readable_register(struct device *dev, unsigned int reg)
pg_num = reg >> 0x8;
if (pg_num == 0x80)
pg_num = PAGE_0X80;
else if (pg_num >= 0xE)
return false;
reg_tbl = wcd9335_reg[pg_num];
reg_offset = reg & 0xFF;