ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe
authorStephen Kitt <steve@sk2.org>
Fri, 25 Mar 2022 16:54:52 +0000 (17:54 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 5 Apr 2022 09:23:09 +0000 (10:23 +0100)
As part of the ongoing i2c transition to the simple probe
("probe_new"), this patch uses i2c_match_id to retrieve the
driver_data for the probed device. The id parameter is thus no longer
necessary and the simple probe can be used instead.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220325165452.1212975-1-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/ad193x-i2c.c
sound/soc/codecs/adau1761-i2c.c
sound/soc/codecs/adau1781-i2c.c
sound/soc/codecs/adau1977-i2c.c
sound/soc/codecs/ssm2602-i2c.c

index 3d509a65e4cafb2dc760b43303978aa5b7ae57a9..4cb8d87f90119296efb78c0e7f0ff0d00a72ea53 100644 (file)
@@ -20,10 +20,10 @@ static const struct i2c_device_id ad193x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ad193x_id);
 
-static int ad193x_i2c_probe(struct i2c_client *client,
-                           const struct i2c_device_id *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;
@@ -38,7 +38,7 @@ static struct i2c_driver ad193x_i2c_driver = {
        .driver = {
                .name = "ad193x",
        },
-       .probe    = ad193x_i2c_probe,
+       .probe_new = ad193x_i2c_probe,
        .id_table = ad193x_id,
 };
 module_i2c_driver(ad193x_i2c_driver);
index c8fce37e5cfa0655f6074d9526e3eb1a0057120b..0683caf86aea0199ec603a14b64c4b9253968e1c 100644 (file)
 
 #include "adau1761.h"
 
-static int adau1761_i2c_probe(struct i2c_client *client,
-       const struct i2c_device_id *id)
+static const struct i2c_device_id adau1761_i2c_ids[];
+
+static int adau1761_i2c_probe(struct i2c_client *client)
 {
        struct regmap_config config;
+       const struct i2c_device_id *id = i2c_match_id(adau1761_i2c_ids, client);
 
        config = adau1761_regmap_config;
        config.val_bits = 8;
@@ -59,7 +61,7 @@ static struct i2c_driver adau1761_i2c_driver = {
                .name = "adau1761",
                .of_match_table = of_match_ptr(adau1761_i2c_dt_ids),
        },
-       .probe = adau1761_i2c_probe,
+       .probe_new = adau1761_i2c_probe,
        .remove = adau1761_i2c_remove,
        .id_table = adau1761_i2c_ids,
 };
index 1c476429ad992c94e699b201bd49db421f2ca681..e046de0ebcc7986928ccf2ac5e22d6b1ae397ff0 100644 (file)
 
 #include "adau1781.h"
 
-static int adau1781_i2c_probe(struct i2c_client *client,
-       const struct i2c_device_id *id)
+static const struct i2c_device_id adau1781_i2c_ids[];
+
+static int adau1781_i2c_probe(struct i2c_client *client)
 {
        struct regmap_config config;
+       const struct i2c_device_id *id = i2c_match_id(adau1781_i2c_ids, client);
 
        config = adau1781_regmap_config;
        config.val_bits = 8;
@@ -55,7 +57,7 @@ static struct i2c_driver adau1781_i2c_driver = {
                .name = "adau1781",
                .of_match_table = of_match_ptr(adau1781_i2c_dt_ids),
        },
-       .probe = adau1781_i2c_probe,
+       .probe_new = adau1781_i2c_probe,
        .remove = adau1781_i2c_remove,
        .id_table = adau1781_i2c_ids,
 };
index 82a49c85d536851cab93ce04e71408542758157d..9f137a0634d520167b346c87ba6d06a9916c1a4e 100644 (file)
 
 #include "adau1977.h"
 
-static int adau1977_i2c_probe(struct i2c_client *client,
-       const struct i2c_device_id *id)
+static const struct i2c_device_id adau1977_i2c_ids[];
+
+static int adau1977_i2c_probe(struct i2c_client *client)
 {
        struct regmap_config config;
+       const struct i2c_device_id *id = i2c_match_id(adau1977_i2c_ids, client);
 
        config = adau1977_regmap_config;
        config.val_bits = 8;
@@ -40,7 +42,7 @@ static struct i2c_driver adau1977_i2c_driver = {
        .driver = {
                .name = "adau1977",
        },
-       .probe = adau1977_i2c_probe,
+       .probe_new = adau1977_i2c_probe,
        .id_table = adau1977_i2c_ids,
 };
 module_i2c_driver(adau1977_i2c_driver);
index afab81383d3ada182cabd577e3e32397b556b69d..3c85772901f5aca7bc589d39327e7aea3be63b68 100644 (file)
 
 #include "ssm2602.h"
 
+static const struct i2c_device_id ssm2602_i2c_id[];
+
 /*
  * ssm2602 2 wire address is determined by GPIO5
  * state during powerup.
  *    low  = 0x1a
  *    high = 0x1b
  */
-static int ssm2602_i2c_probe(struct i2c_client *client,
-                            const struct i2c_device_id *id)
+static int ssm2602_i2c_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_match_id(ssm2602_i2c_id, client);
        return ssm2602_probe(&client->dev, id->driver_data,
                devm_regmap_init_i2c(client, &ssm2602_regmap_config));
 }
@@ -47,7 +49,7 @@ static struct i2c_driver ssm2602_i2c_driver = {
                .name = "ssm2602",
                .of_match_table = ssm2602_of_match,
        },
-       .probe = ssm2602_i2c_probe,
+       .probe_new = ssm2602_i2c_probe,
        .id_table = ssm2602_i2c_id,
 };
 module_i2c_driver(ssm2602_i2c_driver);