[PATCH v3 03/11] mfd: tps6594: add regmap config in match data

Dan Carpenter dan.carpenter at linaro.org
Thu Mar 14 06:30:39 PDT 2024


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




More information about the linux-arm-kernel mailing list