mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/serial/dz.c: Remove save_flags()/cli()/restore_flags()
@ 2006-10-16  7:28 Amol Lad
  2006-10-16 13:23 ` [KJ] " Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Amol Lad @ 2006-10-16  7:28 UTC (permalink / raw)
  To: linux kernel; +Cc: kernel Janitors

Replaced save_flags()/cli()/restore_flags() pair with spin_lock
alternatives.

For this case, I believe spin lock plays no role but I also do not have
a better way.

Tested compile only.

Signed-off-by: Amol Lad <amol@verismonetworks.com>
---
--- linux-2.6.19-rc1-orig/drivers/serial/dz.c	2006-09-21 10:15:41.000000000 +0530
+++ linux-2.6.19-rc1/drivers/serial/dz.c	2006-10-16 12:48:31.000000000 +0530
@@ -778,13 +778,13 @@ int __init dz_init(void)
 {
 	unsigned long flags;
 	int ret, i;
+	spinlock_t dz_lock = SPIN_LOCK_UNLOCKED;
 
 	printk("%s%s\n", dz_name, dz_version);
 
 	dz_init_ports();
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&dz_lock,flags);
 
 #ifndef CONFIG_SERIAL_DZ_CONSOLE
 	/* reset the chip */
@@ -794,7 +794,7 @@ int __init dz_init(void)
 	/* order matters here... the trick is that flags
 	   is updated... in request_irq - to immediatedly obliterate
 	   it is unwise. */
-	restore_flags(flags);
+	spin_unlock_irqrestore(&dz_lock,flags);
 
 	if (request_irq(dz_ports[0].port.irq, dz_interrupt,
 			IRQF_DISABLED, "DZ", &dz_ports[0]))



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-16 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-16  7:28 [PATCH] drivers/serial/dz.c: Remove save_flags()/cli()/restore_flags() Amol Lad
2006-10-16 13:23 ` [KJ] " Matthew Wilcox
2006-10-16 14:01   ` Amol Lad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®