Commit df221682 authored by Stephen Kitt's avatar Stephen Kitt Committed by Stephen Boyd
Browse files

clk: cdce925: use i2c_match_id and simple i2c probe



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: default avatarStephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220407151831.2371706-3-steve@sk2.org


Reviewed-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent f9edf134
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -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 @@ static int cdce925_probe(struct i2c_client *client,
	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);