diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-03 18:06:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:51 -0400 |
commit | a1c805a9bdc55b244706b911e842d0649990953b (patch) | |
tree | b9c864e27515005674a212abbeb5c8be1c9dbdea | |
parent | 6d4a38cbbb311dc93c0f66a702f7d0ae5c5b4965 (diff) |
rtc: rtc-pcap: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata
= NULL when no driver is bound"). Thus, it is not needed to manually
clear the device driver data to NULL.
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>
-rw-r--r-- | drivers/rtc/rtc-pcap.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c index 539a90b98bc5..40b5c630bc7d 100644 --- a/drivers/rtc/rtc-pcap.c +++ b/drivers/rtc/rtc-pcap.c | |||
@@ -156,10 +156,8 @@ static int __init pcap_rtc_probe(struct platform_device *pdev) | |||
156 | 156 | ||
157 | pcap_rtc->rtc = devm_rtc_device_register(&pdev->dev, "pcap", | 157 | pcap_rtc->rtc = devm_rtc_device_register(&pdev->dev, "pcap", |
158 | &pcap_rtc_ops, THIS_MODULE); | 158 | &pcap_rtc_ops, THIS_MODULE); |
159 | if (IS_ERR(pcap_rtc->rtc)) { | 159 | if (IS_ERR(pcap_rtc->rtc)) |
160 | err = PTR_ERR(pcap_rtc->rtc); | 160 | return PTR_ERR(pcap_rtc->rtc); |
161 | goto fail; | ||
162 | } | ||
163 | 161 | ||
164 | timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ); | 162 | timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ); |
165 | alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA); | 163 | alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA); |
@@ -167,17 +165,14 @@ static int __init pcap_rtc_probe(struct platform_device *pdev) | |||
167 | err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq, 0, | 165 | err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq, 0, |
168 | "RTC Timer", pcap_rtc); | 166 | "RTC Timer", pcap_rtc); |
169 | if (err) | 167 | if (err) |
170 | goto fail; | 168 | return err; |
171 | 169 | ||
172 | err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq, 0, | 170 | err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq, 0, |
173 | "RTC Alarm", pcap_rtc); | 171 | "RTC Alarm", pcap_rtc); |
174 | if (err) | 172 | if (err) |
175 | goto fail; | 173 | return err; |
176 | 174 | ||
177 | return 0; | 175 | return 0; |
178 | fail: | ||
179 | platform_set_drvdata(pdev, NULL); | ||
180 | return err; | ||
181 | } | 176 | } |
182 | 177 | ||
183 | static int __exit pcap_rtc_remove(struct platform_device *pdev) | 178 | static int __exit pcap_rtc_remove(struct platform_device *pdev) |