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 --- drivers/phy/phy-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/phy') diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 2eb28cc2d2dc..cd5a6c95dbdc 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -712,7 +712,7 @@ struct phy *phy_optional_get(struct device *dev, const char *string) { struct phy *phy = phy_get(dev, string); - if (IS_ERR(phy) && (PTR_ERR(phy) == -ENODEV)) + if (PTR_ERR(phy) == -ENODEV) phy = NULL; return phy; @@ -766,7 +766,7 @@ struct phy *devm_phy_optional_get(struct device *dev, const char *string) { struct phy *phy = devm_phy_get(dev, string); - if (IS_ERR(phy) && (PTR_ERR(phy) == -ENODEV)) + if (PTR_ERR(phy) == -ENODEV) phy = NULL; return phy; -- cgit v1.2.3