]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: cdce925: use i2c_match_id and simple i2c probe
authorStephen Kitt <steve@sk2.org>
Thu, 7 Apr 2022 15:18:23 +0000 (17:18 +0200)
committerStephen Boyd <sboyd@kernel.org>
Sat, 23 Apr 2022 02:28:07 +0000 (19:28 -0700)
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>
Link: https://lore.kernel.org/r/20220407151831.2371706-3-steve@sk2.org
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-cdce925.c

index 308b353815e170ad22d2fc1a2416c05e06458084..ef9a2d44e40c3670d205975bc2435f2204431711 100644 (file)
@@ -634,11 +634,20 @@ static struct regmap_bus regmap_cdce925_bus = {
        .read = cdce925_regmap_i2c_read,
 };
 
-static int cdce925_probe(struct i2c_client *client,
-               const struct i2c_device_id *id)
+static const struct i2c_device_id cdce925_id[] = {
+       { "cdce913", CDCE913 },
+       { "cdce925", CDCE925 },
+       { "cdce937", CDCE937 },
+       { "cdce949", CDCE949 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, cdce925_id);
+
+static int cdce925_probe(struct i2c_client *client)
 {
        struct clk_cdce925_chip *data;
        struct device_node *node = client->dev.of_node;
+       const struct i2c_device_id *id = i2c_match_id(cdce925_id, client);
        const char *parent_name;
        const char *pll_clk_name[MAX_NUMBER_OF_PLLS] = {NULL,};
        struct clk_init_data init;
@@ -814,15 +823,6 @@ error:
        return err;
 }
 
-static const struct i2c_device_id cdce925_id[] = {
-       { "cdce913", CDCE913 },
-       { "cdce925", CDCE925 },
-       { "cdce937", CDCE937 },
-       { "cdce949", CDCE949 },
-       { }
-};
-MODULE_DEVICE_TABLE(i2c, cdce925_id);
-
 static const struct of_device_id clk_cdce925_of_match[] = {
        { .compatible = "ti,cdce913" },
        { .compatible = "ti,cdce925" },
@@ -837,7 +837,7 @@ static struct i2c_driver cdce925_driver = {
                .name = "cdce925",
                .of_match_table = of_match_ptr(clk_cdce925_of_match),
        },
-       .probe          = cdce925_probe,
+       .probe_new      = cdce925_probe,
        .id_table       = cdce925_id,
 };
 module_i2c_driver(cdce925_driver);