diff options
author | kernel test robot <lkp@intel.com> | 2020-06-08 04:02:53 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-06-16 11:19:53 +0300 |
commit | 3e5b8f87994e1269a7a9ea1862df163b110932eb (patch) | |
tree | 6e1174ce8e6f21682c293f6473d8676a3e7c62ea /drivers/pinctrl/pinctrl-mcp23s08_spi.c | |
parent | 782b6b69847f34dda330530493ea62b7de3fd06a (diff) | |
download | linux-3e5b8f87994e1269a7a9ea1862df163b110932eb.tar.xz |
pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings
drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI")
Signed-off-by: kernel test robot <lkp@intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200608010253.GA79576@44f7ab9e8d59
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-mcp23s08_spi.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-mcp23s08_spi.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-mcp23s08_spi.c b/drivers/pinctrl/pinctrl-mcp23s08_spi.c index e06fb885fd2b..1f47a661b0a7 100644 --- a/drivers/pinctrl/pinctrl-mcp23s08_spi.c +++ b/drivers/pinctrl/pinctrl-mcp23s08_spi.c @@ -126,10 +126,7 @@ static int mcp23s08_spi_regmap_init(struct mcp23s08 *mcp, struct device *dev, copy->name = name; mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, copy); - if (IS_ERR(mcp->regmap)) - return PTR_ERR(mcp->regmap); - - return 0; + return PTR_ERR_OR_ZERO(mcp->regmap); } static int mcp23s08_probe(struct spi_device *spi) |