]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: phy: isp1301: Add OF device ID table
authorJavier Martinez Canillas <javier@osg.samsung.com>
Wed, 22 Feb 2017 18:23:22 +0000 (15:23 -0300)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 17 Jan 2018 17:55:32 +0000 (12:55 -0500)
[ Upstream commit fd567653bdb908009b650f079bfd4b63169e2ac4 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/usb/phy/phy-isp1301.c

index 8a55b37d1a024687f6be8078ef4f54f60cdc5111..d2ed59a383541a5627321b1d75a8137848f9d3ed 100644 (file)
@@ -32,6 +32,12 @@ static const struct i2c_device_id isp1301_id[] = {
        { }
 };
 
+static const struct of_device_id isp1301_of_match[] = {
+       {.compatible = "nxp,isp1301" },
+       { },
+};
+MODULE_DEVICE_TABLE(of, isp1301_of_match);
+
 static struct i2c_client *isp1301_i2c_client;
 
 static int __isp1301_write(struct isp1301 *isp, u8 reg, u8 value, u8 clear)
@@ -129,6 +135,7 @@ static int isp1301_remove(struct i2c_client *client)
 static struct i2c_driver isp1301_driver = {
        .driver = {
                .name = DRV_NAME,
+               .of_match_table = of_match_ptr(isp1301_of_match),
        },
        .probe = isp1301_probe,
        .remove = isp1301_remove,