summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tas2562.c
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2024-12-03 13:59:53 -0600
committerMark Brown <broonie@kernel.org>2024-12-09 13:12:38 +0000
commiteb4b5da0ecf61135533574285bacb9dab4fc4703 (patch)
tree7cc5aca4b9220a74b288db76fc32e9aca1e0c967 /sound/soc/codecs/tas2562.c
parent6c978c1baeb8449114e8cb35c68832e903f713d8 (diff)
ASoC: tas2562: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from the i2c_device_id table. This is often used to then retrieve the matching driver_data. This can be done in one step with the helper i2c_get_match_data(). This helper has a couple other benefits: * It doesn't need the i2c_device_id passed in so we do not need to have that forward declared, allowing us to remove those or move the i2c_device_id table down to its more natural spot with the other module info. * It also checks for device match data, which allows for OF and ACPI based probing. That means we do not have to manually check those first and can remove those checks. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://patch.msgid.link/20241203200001.197295-13-afd@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tas2562.c')
-rw-r--r--sound/soc/codecs/tas2562.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c
index 54561ae598b8..fef7ce39f664 100644
--- a/sound/soc/codecs/tas2562.c
+++ b/sound/soc/codecs/tas2562.c
@@ -731,16 +731,14 @@ static int tas2562_probe(struct i2c_client *client)
struct device *dev = &client->dev;
struct tas2562_data *data;
int ret;
- const struct i2c_device_id *id;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
- id = i2c_match_id(tas2562_id, client);
data->client = client;
data->dev = &client->dev;
- data->model_id = id->driver_data;
+ data->model_id = (uintptr_t)i2c_get_match_data(client);
tas2562_parse_dt(data);