Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: phy: isp1301: Add OF device ID table

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Javier Martinez Canillas and committed by
Greg Kroah-Hartman
fd567653 85550f91

+7
+7
drivers/usb/phy/phy-isp1301.c
··· 33 33 }; 34 34 MODULE_DEVICE_TABLE(i2c, isp1301_id); 35 35 36 + static const struct of_device_id isp1301_of_match[] = { 37 + {.compatible = "nxp,isp1301" }, 38 + { }, 39 + }; 40 + MODULE_DEVICE_TABLE(of, isp1301_of_match); 41 + 36 42 static struct i2c_client *isp1301_i2c_client; 37 43 38 44 static int __isp1301_write(struct isp1301 *isp, u8 reg, u8 value, u8 clear) ··· 136 130 static struct i2c_driver isp1301_driver = { 137 131 .driver = { 138 132 .name = DRV_NAME, 133 + .of_match_table = of_match_ptr(isp1301_of_match), 139 134 }, 140 135 .probe = isp1301_probe, 141 136 .remove = isp1301_remove,