--- zzzz-none-000/linux-3.10.107/drivers/i2c/busses/i2c-cbus-gpio.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/i2c/busses/i2c-cbus-gpio.c 2021-02-04 17:41:59.000000000 +0000 @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -233,8 +232,9 @@ chost->clk_gpio = of_get_gpio(dnode, 0); chost->dat_gpio = of_get_gpio(dnode, 1); chost->sel_gpio = of_get_gpio(dnode, 2); - } else if (pdev->dev.platform_data) { - struct i2c_cbus_platform_data *pdata = pdev->dev.platform_data; + } else if (dev_get_platdata(&pdev->dev)) { + struct i2c_cbus_platform_data *pdata = + dev_get_platdata(&pdev->dev); chost->clk_gpio = pdata->clk_gpio; chost->dat_gpio = pdata->dat_gpio; chost->sel_gpio = pdata->sel_gpio; @@ -245,6 +245,7 @@ adapter->owner = THIS_MODULE; adapter->class = I2C_CLASS_HWMON; adapter->dev.parent = &pdev->dev; + adapter->dev.of_node = pdev->dev.of_node; adapter->nr = pdev->id; adapter->timeout = HZ; adapter->algo = &cbus_i2c_algo; @@ -286,8 +287,8 @@ .probe = cbus_i2c_probe, .remove = cbus_i2c_remove, .driver = { - .owner = THIS_MODULE, .name = "i2c-cbus-gpio", + .of_match_table = of_match_ptr(i2c_cbus_dt_ids), }, }; module_platform_driver(cbus_i2c_driver);