use API devm_i2c_add_adapter instead of i2c_add_adapter, remove callback remove_new. Signed-off-by: Hans Hu <hanshu-oc@xxxxxxxxxxx> --- drivers/i2c/busses/i2c-wmt.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c-wmt.c b/drivers/i2c/busses/i2c-wmt.c index ec2a8da134e5..406b6827c42d 100644 --- a/drivers/i2c/busses/i2c-wmt.c +++ b/drivers/i2c/busses/i2c-wmt.c @@ -376,23 +376,9 @@ static int wmt_i2c_probe(struct platform_device *pdev) return err; } - err = i2c_add_adapter(adap); - if (err) - return err; - platform_set_drvdata(pdev, i2c_dev); - return 0; -} - -static void wmt_i2c_remove(struct platform_device *pdev) -{ - struct wmt_i2c_dev *i2c_dev = platform_get_drvdata(pdev); - - /* Disable interrupts, clock and delete adapter */ - writew(0, i2c_dev->base + REG_IMR); - clk_disable_unprepare(i2c_dev->clk); - i2c_del_adapter(&i2c_dev->adapter); + return devm_i2c_add_adapter(&pdev->dev, &i2c_dev->adapter); } static const struct of_device_id wmt_i2c_dt_ids[] = { @@ -402,7 +388,6 @@ static const struct of_device_id wmt_i2c_dt_ids[] = { static struct platform_driver wmt_i2c_driver = { .probe = wmt_i2c_probe, - .remove_new = wmt_i2c_remove, .driver = { .name = "wmt-i2c", .of_match_table = wmt_i2c_dt_ids, -- 2.34.1