Skip to content

Commit f234f02

Browse files
bijudasbebarino
authored andcommitted
clk: si5351: Simplify probe
The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Simplify probe() by replacing ID lookup table for retrieving match data with i2c_get_match_data(). Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 38a929a commit f234f02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/clk-si5351.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,15 +1385,15 @@ MODULE_DEVICE_TABLE(i2c, si5351_i2c_ids);
13851385

13861386
static int si5351_i2c_probe(struct i2c_client *client)
13871387
{
1388-
const struct i2c_device_id *id = i2c_match_id(si5351_i2c_ids, client);
1389-
enum si5351_variant variant = (enum si5351_variant)id->driver_data;
1388+
enum si5351_variant variant;
13901389
struct si5351_platform_data *pdata;
13911390
struct si5351_driver_data *drvdata;
13921391
struct clk_init_data init;
13931392
const char *parent_names[4];
13941393
u8 num_parents, num_clocks;
13951394
int ret, n;
13961395

1396+
variant = (enum si5351_variant)(uintptr_t)i2c_get_match_data(client);
13971397
ret = si5351_dt_parse(client, variant);
13981398
if (ret)
13991399
return ret;

0 commit comments

Comments
 (0)