summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-pcf8583.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 06:47:50 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 06:47:50 +0400
commit56847d857cb0c3ee78c22ce776a26f88d9ffd4d4 (patch)
treea85bcf204a53e45d26f6a3984f16ddd525eef3e7 /drivers/rtc/rtc-pcf8583.c
parent191a712090bb8a10e6f129360eeed2d68f3d4c9a (diff)
parent8d564368a9a3197f43e56dadf4a18c5738849f94 (diff)
downloadlinux-56847d857cb0c3ee78c22ce776a26f88d9ffd4d4.tar.xz
Merge branch 'akpm' (incoming from Andrew)
Merge second batch of fixes from Andrew Morton: - various misc bits - some printk updates - a new "SRAM" driver. - MAINTAINERS updates - the backlight driver queue - checkpatch updates - a few init/ changes - a huge number of drivers/rtc changes - fatfs updates - some lib/idr.c work - some renaming of the random driver interfaces * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (285 commits) net: rename random32 to prandom net/core: remove duplicate statements by do-while loop net/core: rename random32() to prandom_u32() net/netfilter: rename random32() to prandom_u32() net/sched: rename random32() to prandom_u32() net/sunrpc: rename random32() to prandom_u32() scsi: rename random32() to prandom_u32() lguest: rename random32() to prandom_u32() uwb: rename random32() to prandom_u32() video/uvesafb: rename random32() to prandom_u32() mmc: rename random32() to prandom_u32() drbd: rename random32() to prandom_u32() kernel/: rename random32() to prandom_u32() mm/: rename random32() to prandom_u32() lib/: rename random32() to prandom_u32() x86: rename random32() to prandom_u32() x86: pageattr-test: remove srandom32 call uuid: use prandom_bytes() raid6test: use prandom_bytes() sctp: convert sctp_assoc_set_id() to use idr_alloc_cyclic() ...
Diffstat (limited to 'drivers/rtc/rtc-pcf8583.c')
-rw-r--r--drivers/rtc/rtc-pcf8583.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
index 5f97c61247d5..95886dcf4a39 100644
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -268,39 +268,29 @@ static int pcf8583_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct pcf8583 *pcf8583;
- int err;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
return -ENODEV;
- pcf8583 = kzalloc(sizeof(struct pcf8583), GFP_KERNEL);
+ pcf8583 = devm_kzalloc(&client->dev, sizeof(struct pcf8583),
+ GFP_KERNEL);
if (!pcf8583)
return -ENOMEM;
i2c_set_clientdata(client, pcf8583);
- pcf8583->rtc = rtc_device_register(pcf8583_driver.driver.name,
- &client->dev, &pcf8583_rtc_ops, THIS_MODULE);
+ pcf8583->rtc = devm_rtc_device_register(&client->dev,
+ pcf8583_driver.driver.name,
+ &pcf8583_rtc_ops, THIS_MODULE);
- if (IS_ERR(pcf8583->rtc)) {
- err = PTR_ERR(pcf8583->rtc);
- goto exit_kfree;
- }
+ if (IS_ERR(pcf8583->rtc))
+ return PTR_ERR(pcf8583->rtc);
return 0;
-
-exit_kfree:
- kfree(pcf8583);
- return err;
}
static int pcf8583_remove(struct i2c_client *client)
{
- struct pcf8583 *pcf8583 = i2c_get_clientdata(client);
-
- if (pcf8583->rtc)
- rtc_device_unregister(pcf8583->rtc);
- kfree(pcf8583);
return 0;
}