[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZRE8Oq4Xpklvism9@smile.fi.intel.com>
Date: Mon, 25 Sep 2023 10:52:26 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Biju Das <biju.das.jz@...renesas.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Biju Das <biju.das.au@...il.com>
Subject: Re: [PATCH v3 3/3] pinctrl: mcp23s08: Simplify
probe()/mcp23s08_spi_regmap_init()
On Sun, Sep 24, 2023 at 06:23:20PM +0100, Biju Das wrote:
> Add struct mcp23s08_info and simplify probe()/mcp23s08_spi_regmap_init() by
> replacing match data 'type' with 'struct mcp23s08_info'.
>
> While at it, replace 'dev_err()'->'dev_err_probe()' and drop printing
> 'type' in error path for i2c_get_match_data().
No need to duplicate info in the name of variables (see below).
With this fixed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
...
> +static const struct mcp23s08_info mcp23s08_i2c_0008 = {
static const struct mcp23s08_info mcp23008_i2c = {
> + .regmap = &mcp23x08_regmap,
> + .label = "mcp23008",
> + .type = MCP_TYPE_008,
> + .ngpio = 8,
> + .reg_shift = 0,
> +};
> +
> +static const struct mcp23s08_info mcp23s08_i2c_0017 = {
static const struct mcp23s08_info mcp23017_i2c = {
> + .regmap = &mcp23x17_regmap,
> + .label = "mcp23017",
> + .type = MCP_TYPE_017,
> + .ngpio = 16,
> + .reg_shift = 1,
> +};
> +
> +static const struct mcp23s08_info mcp23s08_i2c_0018 = {
static const struct mcp23s08_info mcp23018_i2c = {
> + .regmap = &mcp23x17_regmap,
> + .label = "mcp23018",
> + .type = MCP_TYPE_018,
> + .ngpio = 16,
> + .reg_shift = 1,
> +};
...
> +static const struct mcp23s08_info mcp23s08_spi_s08 = {
static const struct mcp23s08_info mcp23s08_spi = {
> + .regmap = &mcp23x08_regmap,
> + .type = MCP_TYPE_S08,
> + .ngpio = 8,
> + .reg_shift = 0,
> +};
> +
> +static const struct mcp23s08_info mcp23s08_spi_s17 = {
static const struct mcp23s08_info mcp23s17_spi = {
> + .regmap = &mcp23x17_regmap,
> + .type = MCP_TYPE_S17,
> + .ngpio = 16,
> + .reg_shift = 1,
> +};
> +
> +static const struct mcp23s08_info mcp23s08_spi_s18 = {
static const struct mcp23s08_info mcp23s18_spi = {
> + .regmap = &mcp23x17_regmap,
> + .label = "mcp23s18",
> + .type = MCP_TYPE_S18,
> + .ngpio = 16,
> + .reg_shift = 1,
> +};
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists