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@xxxxxx> --- sound/soc/codecs/ad193x-i2c.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/ad193x-i2c.c b/sound/soc/codecs/ad193x-i2c.c index 15d74bb31c4c5..6aa168e01fbbd 100644 --- a/sound/soc/codecs/ad193x-i2c.c +++ b/sound/soc/codecs/ad193x-i2c.c @@ -23,7 +23,6 @@ MODULE_DEVICE_TABLE(i2c, ad193x_id); static int ad193x_i2c_probe(struct i2c_client *client) { struct regmap_config config; - const struct i2c_device_id *id = i2c_match_id(ad193x_id, client); config = ad193x_regmap_config; config.val_bits = 8; @@ -31,7 +30,7 @@ static int ad193x_i2c_probe(struct i2c_client *client) return ad193x_probe(&client->dev, devm_regmap_init_i2c(client, &config), - (enum ad193x_type)id->driver_data); + (uintptr_t)i2c_get_match_data(client)); } static struct i2c_driver ad193x_i2c_driver = { -- 2.39.2
- Follow-Ups:
- Re: [PATCH 01/21] ASoC: ad193x: Remove use of i2c_match_id()
- From: Mark Brown
- [PATCH 06/21] ASoC: alc5632: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 18/21] ASoC: tlv320aic3x: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 13/21] ASoC: tas2562: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 10/21] ASoC: pcm186x: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 20/21] ASoC: wm8904: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 16/21] ASoC: tlv320adc3xxx: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 07/21] ASoC: max98088: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 04/21] ASoC: adau1977: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 15/21] ASoC: tas5720: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 12/21] ASoC: ssm2602: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 21/21] ASoC: wm8985: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 19/21] ASoC: tpa6130a2: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 11/21] ASoc: pcm6240: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 14/21] ASoC: tas2781: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 09/21] ASoC: max98095: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 08/21] ASoC: max98090: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 05/21] ASoC: alc5623: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 17/21] ASoC: tlv320aic31xx: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 02/21] ASoC: adau1761: Remove use of i2c_match_id()
- From: Andrew Davis
- [PATCH 03/21] ASoC: adau1781: Remove use of i2c_match_id()
- From: Andrew Davis
- Re: [PATCH 01/21] ASoC: ad193x: Remove use of i2c_match_id()
- Prev by Date: [PATCH 13/21] ASoC: tas2562: Remove use of i2c_match_id()
- Next by Date: [PATCH 18/21] ASoC: tlv320aic3x: Remove use of i2c_match_id()
- Previous by thread: [PATCH] ASoC: mediatek: mt8188-mt6359: Remove hardcoded dmic codec
- Next by thread: [PATCH 03/21] ASoC: adau1781: Remove use of i2c_match_id()
- Index(es):