diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/rt286.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index ea967978ec6b..842cfb9fa191 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c | |||
@@ -1219,7 +1219,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, | |||
1219 | { | 1219 | { |
1220 | struct rt286_platform_data *pdata = dev_get_platdata(&i2c->dev); | 1220 | struct rt286_platform_data *pdata = dev_get_platdata(&i2c->dev); |
1221 | struct rt286_priv *rt286; | 1221 | struct rt286_priv *rt286; |
1222 | int i, ret; | 1222 | int i, ret, val; |
1223 | 1223 | ||
1224 | rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286), | 1224 | rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286), |
1225 | GFP_KERNEL); | 1225 | GFP_KERNEL); |
@@ -1234,11 +1234,15 @@ static int rt286_i2c_probe(struct i2c_client *i2c, | |||
1234 | return ret; | 1234 | return ret; |
1235 | } | 1235 | } |
1236 | 1236 | ||
1237 | regmap_read(rt286->regmap, | 1237 | ret = regmap_read(rt286->regmap, |
1238 | RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &ret); | 1238 | RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val); |
1239 | if (ret != RT286_VENDOR_ID && ret != RT288_VENDOR_ID) { | 1239 | if (ret != 0) { |
1240 | dev_err(&i2c->dev, "I2C error %d\n", ret); | ||
1241 | return ret; | ||
1242 | } | ||
1243 | if (val != RT286_VENDOR_ID && val != RT288_VENDOR_ID) { | ||
1240 | dev_err(&i2c->dev, | 1244 | dev_err(&i2c->dev, |
1241 | "Device with ID register %x is not rt286\n", ret); | 1245 | "Device with ID register %x is not rt286\n", val); |
1242 | return -ENODEV; | 1246 | return -ENODEV; |
1243 | } | 1247 | } |
1244 | 1248 | ||