rtc: rtc-bq32k: use devm_rtc_device_register()
authorJingoo Han <jg1.han@samsung.com>
Mon, 29 Apr 2013 23:19:31 +0000 (16:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:29 +0000 (18:28 -0700)
devm_rtc_device_register() is device managed and makes cleanup paths
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-bq32k.c

index 036cb89f81882c5864e5b0cf43b8e995d4d63d1a..fea78bc713ca243ec6737ca99afb482cca6a7451 100644 (file)
@@ -153,7 +153,7 @@ static int bq32k_probe(struct i2c_client *client,
        if (error)
                return error;
 
-       rtc = rtc_device_register(bq32k_driver.driver.name, &client->dev,
+       rtc = devm_rtc_device_register(&client->dev, bq32k_driver.driver.name,
                                                &bq32k_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
@@ -165,9 +165,6 @@ static int bq32k_probe(struct i2c_client *client,
 
 static int bq32k_remove(struct i2c_client *client)
 {
-       struct rtc_device *rtc = i2c_get_clientdata(client);
-
-       rtc_device_unregister(rtc);
        return 0;
 }