From 45586c7078d42b932c5399953d21746800083691 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 3 Feb 2020 17:37:45 -0800 Subject: treewide: remove redundant IS_ERR() before error code check 'PTR_ERR(p) == -E*' is a stronger condition than IS_ERR(p). Hence, IS_ERR(p) is unneeded. The semantic patch that generates this commit is as follows: // @@ expression ptr; constant error_code; @@ -IS_ERR(ptr) && (PTR_ERR(ptr) == - error_code) +PTR_ERR(ptr) == - error_code // Link: http://lkml.kernel.org/r/20200106045833.1725-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada Cc: Julia Lawall Acked-by: Stephen Boyd [drivers/clk/clk.c] Acked-by: Bartosz Golaszewski [GPIO] Acked-by: Wolfram Sang [drivers/i2c] Acked-by: Rafael J. Wysocki [acpi/scan.c] Acked-by: Rob Herring Cc: Eric Biggers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/soc/codecs/ak4104.c | 3 +-- sound/soc/codecs/cs4270.c | 3 +-- sound/soc/codecs/tlv320aic32x4.c | 6 ++---- sound/soc/sunxi/sun4i-spdif.c | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c index e8c5fda82e08..979cfb165eed 100644 --- a/sound/soc/codecs/ak4104.c +++ b/sound/soc/codecs/ak4104.c @@ -295,8 +295,7 @@ static int ak4104_spi_probe(struct spi_device *spi) reset_gpiod = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(reset_gpiod) && - PTR_ERR(reset_gpiod) == -EPROBE_DEFER) + if (PTR_ERR(reset_gpiod) == -EPROBE_DEFER) return -EPROBE_DEFER; /* read the 'reserved' register - according to the datasheet, it diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 793a14d58667..5f25b9f872bd 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c @@ -681,8 +681,7 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, reset_gpiod = devm_gpiod_get_optional(&i2c_client->dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(reset_gpiod) && - PTR_ERR(reset_gpiod) == -EPROBE_DEFER) + if (PTR_ERR(reset_gpiod) == -EPROBE_DEFER) return -EPROBE_DEFER; cs4270->regmap = devm_regmap_init_i2c(i2c_client, &cs4270_regmap); diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index b4e9a6c73f90..d087f3b20b1d 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c @@ -1098,11 +1098,9 @@ static int aic32x4_setup_regulators(struct device *dev, return PTR_ERR(aic32x4->supply_av); } } else { - if (IS_ERR(aic32x4->supply_dv) && - PTR_ERR(aic32x4->supply_dv) == -EPROBE_DEFER) + if (PTR_ERR(aic32x4->supply_dv) == -EPROBE_DEFER) return -EPROBE_DEFER; - if (IS_ERR(aic32x4->supply_av) && - PTR_ERR(aic32x4->supply_av) == -EPROBE_DEFER) + if (PTR_ERR(aic32x4->supply_av) == -EPROBE_DEFER) return -EPROBE_DEFER; } diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index cbe598b0fb10..98a9fe645521 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -555,7 +555,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) if (quirks->has_reset) { host->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); - if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { + if (PTR_ERR(host->rst) == -EPROBE_DEFER) { ret = -EPROBE_DEFER; dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); return ret; -- cgit v1.2.3-70-g09d2