diff mbox

pinctrl: mcp23s08: Fix MCP23S18 regression

Message ID 8e3a01eb43fbad9e76a75c3f368bf4a74a56ca1b.1519073475.git.jan.kundrat@cesnet.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kundrát Feb. 19, 2018, 8:50 p.m. UTC
In commit 9b3e4207661e I introduced a regression on MCP23S18 where
probing would always fail with ENOMEM.

Unlike the xxx08 and xxx17 variants, the MCP23S18 does not support SPI
addressing, and therefore there are no duplicate debugfs entries for
this particular chip, ever. That's why this code should not care about
the one_regmap_config being NULL. That variable is not used in this
branch at all.

Sorry, and thanks for catching this early.

Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Reported-by: Phil Reid <preid@electromag.com.au>
Fixes: 9b3e4207661e ("pinctrl: mcp23s08: spi: Fix regmap debugfs entries")
---
 drivers/pinctrl/pinctrl-mcp23s08.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jan Kundrát Feb. 19, 2018, 8:57 p.m. UTC | #1
On pondělí 19. února 2018 21:50:21 CET, Jan Kundrát wrote:
> In commit 9b3e4207661e I introduced a regression on MCP23S18 where
> probing would always fail with ENOMEM.
>
> Unlike the xxx08 and xxx17 variants, the MCP23S18 does not support SPI
> addressing, and therefore there are no duplicate debugfs entries for
> this particular chip, ever. That's why this code should not care about
> the one_regmap_config being NULL. That variable is not used in this
> branch at all.
>
> Sorry, and thanks for catching this early.
>
> Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
> Reported-by: Phil Reid <preid@electromag.com.au>
> Fixes: 9b3e4207661e ("pinctrl: mcp23s08: spi: Fix regmap debugfs entries")

Gah, sorry, I missed that Phil already sent a patch which fixes this. 
Please ignore my patch above. I'm having a bad day, apparently :(.

Sorry for noise,
Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index 4d2e1874710c..c873747eceb3 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -821,8 +821,6 @@  static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
 		break;
 
 	case MCP_TYPE_S18:
-		if (!one_regmap_config)
-			return -ENOMEM;
 		mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp,
 					       &mcp23x17_regmap);
 		mcp->reg_shift = 1;