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: // <smpl> @@ expression ptr; constant error_code; @@ -IS_ERR(ptr) && (PTR_ERR(ptr) == - error_code) +PTR_ERR(ptr) == - error_code // </smpl> Link: http://lkml.kernel.org/r/20200106045833.1725-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Cc: Julia Lawall <julia.lawall@lip6.fr> Acked-by: Stephen Boyd <sboyd@kernel.org> [drivers/clk/clk.c] Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> [GPIO] Acked-by: Wolfram Sang <wsa@the-dreams.de> [drivers/i2c] Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [acpi/scan.c] Acked-by: Rob Herring <robh@kernel.org> Cc: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
190535f7cf
commit
45586c7078
@@ -308,7 +308,7 @@ devm_gpiod_get_array_optional(struct device *dev, const char *con_id,
|
||||
struct gpio_descs *descs;
|
||||
|
||||
descs = devm_gpiod_get_array(dev, con_id, flags);
|
||||
if (IS_ERR(descs) && (PTR_ERR(descs) == -ENOENT))
|
||||
if (PTR_ERR(descs) == -ENOENT)
|
||||
return NULL;
|
||||
|
||||
return descs;
|
||||
|
@@ -484,24 +484,24 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
|
||||
break;
|
||||
}
|
||||
|
||||
if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) {
|
||||
if (PTR_ERR(desc) == -ENOENT) {
|
||||
/* Special handling for SPI GPIOs if used */
|
||||
desc = of_find_spi_gpio(dev, con_id, &of_flags);
|
||||
}
|
||||
|
||||
if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) {
|
||||
if (PTR_ERR(desc) == -ENOENT) {
|
||||
/* This quirk looks up flags and all */
|
||||
desc = of_find_spi_cs_gpio(dev, con_id, idx, flags);
|
||||
if (!IS_ERR(desc))
|
||||
return desc;
|
||||
}
|
||||
|
||||
if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) {
|
||||
if (PTR_ERR(desc) == -ENOENT) {
|
||||
/* Special handling for regulator GPIOs if used */
|
||||
desc = of_find_regulator_gpio(dev, con_id, &of_flags);
|
||||
}
|
||||
|
||||
if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT)
|
||||
if (PTR_ERR(desc) == -ENOENT)
|
||||
desc = of_find_arizona_gpio(dev, con_id, &of_flags);
|
||||
|
||||
if (IS_ERR(desc))
|
||||
|
@@ -5039,7 +5039,7 @@ struct gpio_descs *__must_check gpiod_get_array_optional(struct device *dev,
|
||||
struct gpio_descs *descs;
|
||||
|
||||
descs = gpiod_get_array(dev, con_id, flags);
|
||||
if (IS_ERR(descs) && (PTR_ERR(descs) == -ENOENT))
|
||||
if (PTR_ERR(descs) == -ENOENT)
|
||||
return NULL;
|
||||
|
||||
return descs;
|
||||
|
Reference in New Issue
Block a user