[PATCH] char: tlclk: clear useflags when request_irq() fails

From: Li Youhong

Date: Fri Aug 28 2026 - 02:28:22 EST


From: Li Youhong <liyouhong@xxxxxxxxxx>

If request_irq() fails after the exclusive open bit is set, clear the
bit so a subsequent open() is not permanently rejected with -EBUSY.

Signed-off-by: Li Youhong <liyouhong@xxxxxxxxxx>
---
drivers/char/tlclk.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index 255f69123af5..355f68d7bf4d 100644
--- a/drivers/char/tlclk.c
+++ b/drivers/char/tlclk.c
@@ -228,6 +228,9 @@ static int tlclk_open(struct inode *inode, struct file *filp)
else
inb(TLCLK_REG6); /* Clear interrupt events */

+ if (result)
+ clear_bit(0, &useflags);
+
out:
mutex_unlock(&tlclk_mutex);
return result;
--
2.25.1