aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-fm3130.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c
index 4d4ad3fcb5e9..2835fb6c1965 100644
--- a/drivers/rtc/rtc-fm3130.c
+++ b/drivers/rtc/rtc-fm3130.c
@@ -358,7 +358,7 @@ static int fm3130_probe(struct i2c_client *client,
358 I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) 358 I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
359 return -EIO; 359 return -EIO;
360 360
361 fm3130 = kzalloc(sizeof(struct fm3130), GFP_KERNEL); 361 fm3130 = devm_kzalloc(&client->dev, sizeof(struct fm3130), GFP_KERNEL);
362 362
363 if (!fm3130) 363 if (!fm3130)
364 return -ENOMEM; 364 return -ENOMEM;
@@ -507,7 +507,7 @@ bad_clock:
507 507
508 /* We won't bail out here because we just got invalid data. 508 /* We won't bail out here because we just got invalid data.
509 Time setting from u-boot doesn't work anyway */ 509 Time setting from u-boot doesn't work anyway */
510 fm3130->rtc = rtc_device_register(client->name, &client->dev, 510 fm3130->rtc = devm_rtc_device_register(&client->dev, client->name,
511 &fm3130_rtc_ops, THIS_MODULE); 511 &fm3130_rtc_ops, THIS_MODULE);
512 if (IS_ERR(fm3130->rtc)) { 512 if (IS_ERR(fm3130->rtc)) {
513 err = PTR_ERR(fm3130->rtc); 513 err = PTR_ERR(fm3130->rtc);
@@ -517,16 +517,11 @@ bad_clock:
517 } 517 }
518 return 0; 518 return 0;
519exit_free: 519exit_free:
520 kfree(fm3130);
521 return err; 520 return err;
522} 521}
523 522
524static int fm3130_remove(struct i2c_client *client) 523static int fm3130_remove(struct i2c_client *client)
525{ 524{
526 struct fm3130 *fm3130 = i2c_get_clientdata(client);
527
528 rtc_device_unregister(fm3130->rtc);
529 kfree(fm3130);
530 return 0; 525 return 0;
531} 526}
532 527