meson: adc: fix coverity warning
authorYingyuan Zhu <yingyuan.zhu@amlogic.com>
Wed, 29 Aug 2018 12:27:10 +0000 (20:27 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 5 Sep 2018 10:49:07 +0000 (03:49 -0700)
commit8852c2a272071fcbaf1eb55c0843370050304cd1
treef6ab10913cb60dc2b54debfa1ffaf05d9d4a73fa
parent764d0b0e9fb5f3fa37b84ff5acb90ca56a869d06
meson: adc: fix coverity warning

PD#172721: meson: adc: fix coverity warning

1.Function "regmap_write" does not check the return value.
2.There's a risk of dividing by 0.
3.There is a risk of null pointer dereferencing the reference
This causes "Unchecked return value" and "Division or modulo by zero".

Change-Id: I10a04dbd49db2d3f3e7def18b6b9eb9f836bc9f0
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
drivers/amlogic/iio/adc/meson_saradc.c