From: Jingoo Han Date: Mon, 29 Apr 2013 23:19:31 +0000 (-0700) Subject: rtc: rtc-bq32k: use devm_rtc_device_register() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4e440681f47709ce0a8fe61831e263f8a1bbec46;p=linux-beck.git rtc: rtc-bq32k: use devm_rtc_device_register() devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c index 036cb89f8188..fea78bc713ca 100644 --- a/drivers/rtc/rtc-bq32k.c +++ b/drivers/rtc/rtc-bq32k.c @@ -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; }