diff options
author | Tzung-Bi Shih <tzungbi@google.com> | 2020-04-30 16:22:26 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-04-30 14:06:48 +0100 |
commit | 38c2e325a66b1c4d694d2a15b5efa81e5ae38872 (patch) | |
tree | c97df4329df1e4a7f75398a8c55fa364b5b924c2 | |
parent | 79149fb835d762493db6b8b545527069d592d51b (diff) | |
download | linux-stable-38c2e325a66b1c4d694d2a15b5efa81e5ae38872.tar.gz linux-stable-38c2e325a66b1c4d694d2a15b5efa81e5ae38872.tar.bz2 linux-stable-38c2e325a66b1c4d694d2a15b5efa81e5ae38872.zip |
ASoC: rt5682: simplify assertions
Simplifies assertions for errors.
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/rt5682.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index d36f560ad7a8..e542aab46619 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -3462,7 +3462,7 @@ int rt5682_io_init(struct device *dev, struct sdw_slave *slave) ret = regmap_multi_reg_write(rt5682->regmap, patch_list, ARRAY_SIZE(patch_list)); - if (ret != 0) + if (ret) dev_warn(dev, "Failed to apply regmap patch: %d\n", ret); regmap_write(rt5682->regmap, RT5682_DEPOP_1, 0x0000); @@ -3536,8 +3536,7 @@ static int rt5682_i2c_probe(struct i2c_client *i2c, rt5682 = devm_kzalloc(&i2c->dev, sizeof(struct rt5682_priv), GFP_KERNEL); - - if (rt5682 == NULL) + if (!rt5682) return -ENOMEM; i2c_set_clientdata(i2c, rt5682); @@ -3562,14 +3561,14 @@ static int rt5682_i2c_probe(struct i2c_client *i2c, ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(rt5682->supplies), rt5682->supplies); - if (ret != 0) { + if (ret) { dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); return ret; } ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies), rt5682->supplies); - if (ret != 0) { + if (ret) { dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); return ret; } @@ -3599,7 +3598,7 @@ static int rt5682_i2c_probe(struct i2c_client *i2c, ret = regmap_multi_reg_write(rt5682->regmap, patch_list, ARRAY_SIZE(patch_list)); - if (ret != 0) + if (ret) dev_warn(&i2c->dev, "Failed to apply regmap patch: %d\n", ret); regmap_write(rt5682->regmap, RT5682_DEPOP_1, 0x0000); |