aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/peb2466.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/peb2466.c')
-rw-r--r--sound/soc/codecs/peb2466.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/peb2466.c b/sound/soc/codecs/peb2466.c
index 76ee7e3f4d9b..67ea70cef0c7 100644
--- a/sound/soc/codecs/peb2466.c
+++ b/sound/soc/codecs/peb2466.c
@@ -229,7 +229,8 @@ static int peb2466_reg_read(void *context, unsigned int reg, unsigned int *val)
case PEB2466_CMD_XOP:
case PEB2466_CMD_SOP:
ret = peb2466_read_byte(peb2466, reg, &tmp);
- *val = tmp;
+ if (!ret)
+ *val = tmp;
break;
default:
dev_err(&peb2466->spi->dev, "Not a XOP or SOP command\n");