diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-07-26 15:18:19 +0300 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2019-07-29 10:23:46 +0900 |
commit | d72e3dc7915fc6c54645772c13f4afc0e676c7e2 (patch) | |
tree | 65abe917ccbb5557f398028851410a5b434993d4 /drivers/extcon | |
parent | 005ad18727b489eb9fd6182f8941042e274387dc (diff) | |
download | linux-d72e3dc7915fc6c54645772c13f4afc0e676c7e2.tar.bz2 |
extcon: axp288: Add missed error check
It seems from the very beginning the error check has been missed
in axp288_extcon_log_rsi(). Add it here.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-axp288.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index 7254852e6ec0..694a8d4a57ff 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -135,6 +135,11 @@ static void axp288_extcon_log_rsi(struct axp288_extcon_info *info) int ret; ret = regmap_read(info->regmap, AXP288_PS_BOOT_REASON_REG, &val); + if (ret < 0) { + dev_err(info->dev, "failed to read reset source indicator\n"); + return; + } + for (i = 0, rsi = axp288_pwr_up_down_info; *rsi; rsi++, i++) { if (val & BIT(i)) { dev_dbg(info->dev, "%s\n", *rsi); |