--- zzzz-none-000/linux-3.10.107/drivers/mfd/mc13xxx-i2c.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mfd/mc13xxx-i2c.c 2021-02-04 17:41:59.000000000 +0000 @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -47,7 +46,7 @@ }; MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids); -static struct regmap_config mc13xxx_regmap_i2c_config = { +static const struct regmap_config mc13xxx_regmap_i2c_config = { .reg_bits = 8, .val_bits = 24, @@ -60,7 +59,6 @@ const struct i2c_device_id *id) { struct mc13xxx *mc13xxx; - struct mc13xxx_platform_data *pdata = dev_get_platdata(&client->dev); int ret; mc13xxx = devm_kzalloc(&client->dev, sizeof(*mc13xxx), GFP_KERNEL); @@ -69,16 +67,13 @@ dev_set_drvdata(&client->dev, mc13xxx); - mc13xxx->dev = &client->dev; - mutex_init(&mc13xxx->lock); + mc13xxx->irq = client->irq; mc13xxx->regmap = devm_regmap_init_i2c(client, &mc13xxx_regmap_i2c_config); if (IS_ERR(mc13xxx->regmap)) { ret = PTR_ERR(mc13xxx->regmap); - dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", - ret); - dev_set_drvdata(&client->dev, NULL); + dev_err(&client->dev, "Failed to initialize regmap: %d\n", ret); return ret; } @@ -90,24 +85,17 @@ mc13xxx->variant = (void *)id->driver_data; } - ret = mc13xxx_common_init(mc13xxx, pdata, client->irq); - - return ret; + return mc13xxx_common_init(&client->dev); } static int mc13xxx_i2c_remove(struct i2c_client *client) { - struct mc13xxx *mc13xxx = dev_get_drvdata(&client->dev); - - mc13xxx_common_cleanup(mc13xxx); - - return 0; + return mc13xxx_common_exit(&client->dev); } static struct i2c_driver mc13xxx_i2c_driver = { .id_table = mc13xxx_i2c_device_id, .driver = { - .owner = THIS_MODULE, .name = "mc13xxx", .of_match_table = mc13xxx_dt_ids, },