Commit 579f6b00 authored by Biju Das's avatar Biju Das Committed by Jonathan Cameron
Browse files

iio: accel: adxl313: Use i2c_get_match_data



Replace device_get_match_data() and i2c_match_id() by i2c_get_match
_data() as we have similar I2C and DT-based matching table.

Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230725171624.331283-3-biju.das.jz@bp.renesas.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f636554c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -65,9 +65,7 @@ static int adxl313_i2c_probe(struct i2c_client *client)
	 * Retrieves device specific data as a pointer to a
	 * adxl313_chip_info structure
	 */
	chip_data = device_get_match_data(&client->dev);
	if (!chip_data)
		chip_data = (const struct adxl313_chip_info *)i2c_match_id(adxl313_i2c_id, client)->driver_data;
	chip_data = i2c_get_match_data(client);

	regmap = devm_regmap_init_i2c(client,
				      &adxl31x_i2c_regmap_config[chip_data->type]);