| From 3a969c57066ea6e5156f1ffb87aa339988f0f590 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Fri, 28 Aug 2020 22:32:25 +0100 |
| Subject: pinctrl: mcp23s08: Fix mcp23x17_regmap initialiser |
| |
| From: Thomas Preston <thomas.preston@codethink.co.uk> |
| |
| [ Upstream commit b445f6237744df5e8d4f56f8733b2108c611220a ] |
| |
| The mcp23x17_regmap is initialised with structs named "mcp23x16". |
| However, the mcp23s08 driver doesn't support the MCP23016 device yet, so |
| this appears to be a typo. |
| |
| Fixes: 8f38910ba4f6 ("pinctrl: mcp23s08: switch to regmap caching") |
| Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk> |
| Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> |
| Link: https://lore.kernel.org/r/20200828213226.1734264-2-thomas.preston@codethink.co.uk |
| Signed-off-by: Linus Walleij <linus.walleij@linaro.org> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/pinctrl/pinctrl-mcp23s08.c | 22 +++++++++++----------- |
| 1 file changed, 11 insertions(+), 11 deletions(-) |
| |
| diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c |
| index 22558bf294246..12e7f7c54ffaa 100644 |
| --- a/drivers/pinctrl/pinctrl-mcp23s08.c |
| +++ b/drivers/pinctrl/pinctrl-mcp23s08.c |
| @@ -119,7 +119,7 @@ static const struct regmap_config mcp23x08_regmap = { |
| .max_register = MCP_OLAT, |
| }; |
| |
| -static const struct reg_default mcp23x16_defaults[] = { |
| +static const struct reg_default mcp23x17_defaults[] = { |
| {.reg = MCP_IODIR << 1, .def = 0xffff}, |
| {.reg = MCP_IPOL << 1, .def = 0x0000}, |
| {.reg = MCP_GPINTEN << 1, .def = 0x0000}, |
| @@ -130,23 +130,23 @@ static const struct reg_default mcp23x16_defaults[] = { |
| {.reg = MCP_OLAT << 1, .def = 0x0000}, |
| }; |
| |
| -static const struct regmap_range mcp23x16_volatile_range = { |
| +static const struct regmap_range mcp23x17_volatile_range = { |
| .range_min = MCP_INTF << 1, |
| .range_max = MCP_GPIO << 1, |
| }; |
| |
| -static const struct regmap_access_table mcp23x16_volatile_table = { |
| - .yes_ranges = &mcp23x16_volatile_range, |
| +static const struct regmap_access_table mcp23x17_volatile_table = { |
| + .yes_ranges = &mcp23x17_volatile_range, |
| .n_yes_ranges = 1, |
| }; |
| |
| -static const struct regmap_range mcp23x16_precious_range = { |
| +static const struct regmap_range mcp23x17_precious_range = { |
| .range_min = MCP_GPIO << 1, |
| .range_max = MCP_GPIO << 1, |
| }; |
| |
| -static const struct regmap_access_table mcp23x16_precious_table = { |
| - .yes_ranges = &mcp23x16_precious_range, |
| +static const struct regmap_access_table mcp23x17_precious_table = { |
| + .yes_ranges = &mcp23x17_precious_range, |
| .n_yes_ranges = 1, |
| }; |
| |
| @@ -156,10 +156,10 @@ static const struct regmap_config mcp23x17_regmap = { |
| |
| .reg_stride = 2, |
| .max_register = MCP_OLAT << 1, |
| - .volatile_table = &mcp23x16_volatile_table, |
| - .precious_table = &mcp23x16_precious_table, |
| - .reg_defaults = mcp23x16_defaults, |
| - .num_reg_defaults = ARRAY_SIZE(mcp23x16_defaults), |
| + .volatile_table = &mcp23x17_volatile_table, |
| + .precious_table = &mcp23x17_precious_table, |
| + .reg_defaults = mcp23x17_defaults, |
| + .num_reg_defaults = ARRAY_SIZE(mcp23x17_defaults), |
| .cache_type = REGCACHE_FLAT, |
| .val_format_endian = REGMAP_ENDIAN_LITTLE, |
| }; |
| -- |
| 2.25.1 |
| |