aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorJens Rottmann <JRottmann@LiPPERTEmbedded.de>2010-03-11 17:04:44 -0500
committerThomas Gleixner <tglx@linutronix.de>2010-03-12 16:52:00 -0500
commitfdb19a6cb48407c59a2007063f4005c9384603c3 (patch)
tree38dc487713165509698caf428758f8dbd847f476 /drivers/clocksource
parent522dba7134d6b2e5821d3457f7941ec34f668e6d (diff)
cs5535-clockevt: Free timer in IRQ setup error path
Due to a hardware limitation cs5535_mfgpt_free_timer() cannot actually release the timer hardware, but it will at least free the now unreferenced struct associated with it so calling it is the cleaner thing to do. Signed-off-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de> Acked-by: Andres Salomon <dilinger@collabora.co.uk> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: john stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/cs5535-clockevt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c
index b314a999aabe..d7be69f13154 100644
--- a/drivers/clocksource/cs5535-clockevt.c
+++ b/drivers/clocksource/cs5535-clockevt.c
@@ -154,14 +154,14 @@ static int __init cs5535_mfgpt_init(void)
154 if (cs5535_mfgpt_setup_irq(timer, MFGPT_CMP2, &timer_irq)) { 154 if (cs5535_mfgpt_setup_irq(timer, MFGPT_CMP2, &timer_irq)) {
155 printk(KERN_ERR DRV_NAME ": Could not set up IRQ %d\n", 155 printk(KERN_ERR DRV_NAME ": Could not set up IRQ %d\n",
156 timer_irq); 156 timer_irq);
157 return -EIO; 157 goto err_timer;
158 } 158 }
159 159
160 /* And register it with the kernel */ 160 /* And register it with the kernel */
161 ret = setup_irq(timer_irq, &mfgptirq); 161 ret = setup_irq(timer_irq, &mfgptirq);
162 if (ret) { 162 if (ret) {
163 printk(KERN_ERR DRV_NAME ": Unable to set up the interrupt.\n"); 163 printk(KERN_ERR DRV_NAME ": Unable to set up the interrupt.\n");
164 goto err; 164 goto err_irq;
165 } 165 }
166 166
167 /* Set the clock scale and enable the event mode for CMP2 */ 167 /* Set the clock scale and enable the event mode for CMP2 */
@@ -184,8 +184,10 @@ static int __init cs5535_mfgpt_init(void)
184 184
185 return 0; 185 return 0;
186 186
187err: 187err_irq:
188 cs5535_mfgpt_release_irq(cs5535_event_clock, MFGPT_CMP2, &timer_irq); 188 cs5535_mfgpt_release_irq(cs5535_event_clock, MFGPT_CMP2, &timer_irq);
189err_timer:
190 cs5535_mfgpt_free_timer(cs5535_event_clock);
189 printk(KERN_ERR DRV_NAME ": Unable to set up the MFGPT clock source\n"); 191 printk(KERN_ERR DRV_NAME ": Unable to set up the MFGPT clock source\n");
190 return -EIO; 192 return -EIO;
191} 193}