Skip to content

Commit 4b43576

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: typec: tipd: Supply also I2C driver data
If there is no fwnode, device_get_match_data() does not return anything making the probe to always fail. Using i2c_get_match_data() when there is no fwnode to fix that. Fixes: 5bd4853 ("USB: typec: tps6598x: Add device data to of_device_id") Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 61d2cf0 commit 4b43576

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/usb/typec/tipd/core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,10 @@ static int tps6598x_probe(struct i2c_client *client)
12271227
TPS_REG_INT_PLUG_EVENT;
12281228
}
12291229

1230-
tps->data = device_get_match_data(tps->dev);
1230+
if (dev_fwnode(tps->dev))
1231+
tps->data = device_get_match_data(tps->dev);
1232+
else
1233+
tps->data = i2c_get_match_data(client);
12311234
if (!tps->data)
12321235
return -EINVAL;
12331236

@@ -1426,7 +1429,7 @@ static const struct of_device_id tps6598x_of_match[] = {
14261429
MODULE_DEVICE_TABLE(of, tps6598x_of_match);
14271430

14281431
static const struct i2c_device_id tps6598x_id[] = {
1429-
{ "tps6598x" },
1432+
{ "tps6598x", (kernel_ulong_t)&tps6598x_data },
14301433
{ }
14311434
};
14321435
MODULE_DEVICE_TABLE(i2c, tps6598x_id);

0 commit comments

Comments
 (0)