Loading drivers/rtc/rtc-fm3130.c +2 −7 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ static int fm3130_probe(struct i2c_client *client, I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) return -EIO; fm3130 = kzalloc(sizeof(struct fm3130), GFP_KERNEL); fm3130 = devm_kzalloc(&client->dev, sizeof(struct fm3130), GFP_KERNEL); if (!fm3130) return -ENOMEM; Loading Loading @@ -507,7 +507,7 @@ static int fm3130_probe(struct i2c_client *client, /* We won't bail out here because we just got invalid data. Time setting from u-boot doesn't work anyway */ fm3130->rtc = rtc_device_register(client->name, &client->dev, fm3130->rtc = devm_rtc_device_register(&client->dev, client->name, &fm3130_rtc_ops, THIS_MODULE); if (IS_ERR(fm3130->rtc)) { err = PTR_ERR(fm3130->rtc); Loading @@ -517,16 +517,11 @@ static int fm3130_probe(struct i2c_client *client, } return 0; exit_free: kfree(fm3130); return err; } static int fm3130_remove(struct i2c_client *client) { struct fm3130 *fm3130 = i2c_get_clientdata(client); rtc_device_unregister(fm3130->rtc); kfree(fm3130); return 0; } Loading Loading
drivers/rtc/rtc-fm3130.c +2 −7 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ static int fm3130_probe(struct i2c_client *client, I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) return -EIO; fm3130 = kzalloc(sizeof(struct fm3130), GFP_KERNEL); fm3130 = devm_kzalloc(&client->dev, sizeof(struct fm3130), GFP_KERNEL); if (!fm3130) return -ENOMEM; Loading Loading @@ -507,7 +507,7 @@ static int fm3130_probe(struct i2c_client *client, /* We won't bail out here because we just got invalid data. Time setting from u-boot doesn't work anyway */ fm3130->rtc = rtc_device_register(client->name, &client->dev, fm3130->rtc = devm_rtc_device_register(&client->dev, client->name, &fm3130_rtc_ops, THIS_MODULE); if (IS_ERR(fm3130->rtc)) { err = PTR_ERR(fm3130->rtc); Loading @@ -517,16 +517,11 @@ static int fm3130_probe(struct i2c_client *client, } return 0; exit_free: kfree(fm3130); return err; } static int fm3130_remove(struct i2c_client *client) { struct fm3130 *fm3130 = i2c_get_clientdata(client); rtc_device_unregister(fm3130->rtc); kfree(fm3130); return 0; } Loading