Skip to content

Commit 3e5b8f8

Browse files
intel-lab-lkplinusw
authored andcommitted
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: 0f04a81 ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI") Signed-off-by: kernel test robot <[email protected]> Acked-by: Andy Shevchenko <[email protected]> CC: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/20200608010253.GA79576@44f7ab9e8d59 Signed-off-by: Linus Walleij <[email protected]>
1 parent 782b6b6 commit 3e5b8f8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/pinctrl/pinctrl-mcp23s08_spi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ static int mcp23s08_spi_regmap_init(struct mcp23s08 *mcp, struct device *dev,
126126
copy->name = name;
127127

128128
mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, copy);
129-
if (IS_ERR(mcp->regmap))
130-
return PTR_ERR(mcp->regmap);
131-
132-
return 0;
129+
return PTR_ERR_OR_ZERO(mcp->regmap);
133130
}
134131

135132
static int mcp23s08_probe(struct spi_device *spi)

0 commit comments

Comments
 (0)