On Fri, Mar 08, 2024 at 04:04:47PM +0530, Bhargav Raviprakash wrote:
> +static const struct tps6594_match_data match_data[] = {
> + [TPS6594] = {TPS6594, &tps6594_i2c_regmap_config},
> + [TPS6593] = {TPS6593, &tps6594_i2c_regmap_config},
> + [LP8764] = {LP8764, &tps6594_i2c_regmap_config},
> +};
> +
> static const struct of_device_id tps6594_i2c_of_match_table[] = {
> - { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
> - { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
> - { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, },
> + { .compatible = "ti,tps6594-q1", .data = (void *)&match_data[TPS6594], },
> + { .compatible = "ti,tps6593-q1", .data = (void *)&match_data[TPS6593], },
> + { .compatible = "ti,lp8764-q1", .data = (void *)&match_data[LP8764], },
The casts are no longer required. Same for tps6594_spi_of_match_table.
regards,
dan carpenter
On Thu, 14 Mar 2024 16:30:39 +0300, Dan Carpenter wrote:
> On Fri, Mar 08, 2024 at 04:04:47PM +0530, Bhargav Raviprakash wrote:
> > +static const struct tps6594_match_data match_data[] = {
> > + [TPS6594] = {TPS6594, &tps6594_i2c_regmap_config},
> > + [TPS6593] = {TPS6593, &tps6594_i2c_regmap_config},
> > + [LP8764] = {LP8764, &tps6594_i2c_regmap_config},
> > +};
> > +
> > static const struct of_device_id tps6594_i2c_of_match_table[] = {
> > - { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
> > - { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
> > - { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, },
> > + { .compatible = "ti,tps6594-q1", .data = (void *)&match_data[TPS6594], },
> > + { .compatible = "ti,tps6593-q1", .data = (void *)&match_data[TPS6593], },
> > + { .compatible = "ti,lp8764-q1", .data = (void *)&match_data[LP8764], },
>
> The casts are no longer required. Same for tps6594_spi_of_match_table.
>
> regards,
> dan carpenter
Will remove the casts in the next version. Thanks!
Regards,
Bhargav