mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.5 IrDA] IrCOMM module fix
@ 2003-08-08 18:55 Jean Tourrilhes
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Tourrilhes @ 2003-08-08 18:55 UTC (permalink / raw)
  To: Jeff Garzik, Linux kernel mailing list

ir260_ircomm_owner.diff :
~~~~~~~~~~~~~~~~~~~~~~~
		<Patch from Andrey Borzenkov>
	o [CORRECT] Update module refcount in IrCOMM module


diff -u -p linux/net/irda/ircomm/ircomm_tty.d2.c linux/net/irda/ircomm/ircomm_tty.c
--- linux/net/irda/ircomm/ircomm_tty.d2.c	Fri Aug  8 10:47:13 2003
+++ linux/net/irda/ircomm/ircomm_tty.c	Fri Aug  8 10:51:25 2003
@@ -117,6 +117,7 @@ int __init ircomm_tty_init(void)
 		return -ENOMEM;
 	}
 
+	driver->owner		= THIS_MODULE,
 	driver->driver_name     = "ircomm";
 	driver->name            = "ircomm";
 	driver->devfs_name      = "ircomm";
@@ -363,10 +364,8 @@ static int ircomm_tty_open(struct tty_st
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
-	MOD_INC_USE_COUNT;
 	line = tty->index;
 	if ((line < 0) || (line >= IRCOMM_TTY_PORTS)) {
-		MOD_DEC_USE_COUNT;
 		return -ENODEV;
 	}
 
@@ -377,7 +376,6 @@ static int ircomm_tty_open(struct tty_st
 		self = kmalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL);
 		if (self == NULL) {
 			ERROR("%s(), kmalloc failed!\n", __FUNCTION__);
-			MOD_DEC_USE_COUNT;
 			return -ENOMEM;
 		}
 		memset(self, 0, sizeof(struct ircomm_tty_cb));
@@ -443,7 +441,6 @@ static int ircomm_tty_open(struct tty_st
 			return -ERESTARTSYS;
 		}
 
-		/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
 #ifdef SERIAL_DO_RESTART
 		return ((self->flags & ASYNC_HUP_NOTIFY) ?
 			-EAGAIN : -ERESTARTSYS);
@@ -471,7 +468,6 @@ static int ircomm_tty_open(struct tty_st
 
 	ret = ircomm_tty_block_til_ready(self, filp);
 	if (ret) {
-		/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
 		IRDA_DEBUG(2, 
 		      "%s(), returning after block_til_ready with %d\n", __FUNCTION__ ,
 		      ret);
@@ -503,7 +499,6 @@ static void ircomm_tty_close(struct tty_
 	spin_lock_irqsave(&self->spinlock, flags);
 
 	if (tty_hung_up_p(filp)) {
-		MOD_DEC_USE_COUNT;
 		spin_unlock_irqrestore(&self->spinlock, flags);
 
 		IRDA_DEBUG(0, "%s(), returning 1\n", __FUNCTION__ );
@@ -530,7 +525,6 @@ static void ircomm_tty_close(struct tty_
 		self->open_count = 0;
 	}
 	if (self->open_count) {
-		MOD_DEC_USE_COUNT;
 		spin_unlock_irqrestore(&self->spinlock, flags);
 
 		IRDA_DEBUG(0, "%s(), open count > 0\n", __FUNCTION__ );
@@ -572,8 +566,6 @@ static void ircomm_tty_close(struct tty_
 
 	self->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&self->close_wait);
-
-	MOD_DEC_USE_COUNT;
 }
 
 /*

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

* [PATCH 2.5 IrDA] IrCOMM module fix
@ 2003-08-11 21:02 Jean Tourrilhes
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Tourrilhes @ 2003-08-11 21:02 UTC (permalink / raw)
  To: Jeff Garzik, Linux kernel mailing list

ir260_ircomm_owner.diff :
~~~~~~~~~~~~~~~~~~~~~~~
		<Patch from Andrey Borzenkov>
	o [CORRECT] Update module refcount in IrCOMM module


diff -u -p linux/net/irda/ircomm/ircomm_tty.d2.c linux/net/irda/ircomm/ircomm_tty.c
--- linux/net/irda/ircomm/ircomm_tty.d2.c	Fri Aug  8 10:47:13 2003
+++ linux/net/irda/ircomm/ircomm_tty.c	Fri Aug  8 10:51:25 2003
@@ -117,6 +117,7 @@ int __init ircomm_tty_init(void)
 		return -ENOMEM;
 	}
 
+	driver->owner		= THIS_MODULE,
 	driver->driver_name     = "ircomm";
 	driver->name            = "ircomm";
 	driver->devfs_name      = "ircomm";
@@ -363,10 +364,8 @@ static int ircomm_tty_open(struct tty_st
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
-	MOD_INC_USE_COUNT;
 	line = tty->index;
 	if ((line < 0) || (line >= IRCOMM_TTY_PORTS)) {
-		MOD_DEC_USE_COUNT;
 		return -ENODEV;
 	}
 
@@ -377,7 +376,6 @@ static int ircomm_tty_open(struct tty_st
 		self = kmalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL);
 		if (self == NULL) {
 			ERROR("%s(), kmalloc failed!\n", __FUNCTION__);
-			MOD_DEC_USE_COUNT;
 			return -ENOMEM;
 		}
 		memset(self, 0, sizeof(struct ircomm_tty_cb));
@@ -443,7 +441,6 @@ static int ircomm_tty_open(struct tty_st
 			return -ERESTARTSYS;
 		}
 
-		/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
 #ifdef SERIAL_DO_RESTART
 		return ((self->flags & ASYNC_HUP_NOTIFY) ?
 			-EAGAIN : -ERESTARTSYS);
@@ -471,7 +468,6 @@ static int ircomm_tty_open(struct tty_st
 
 	ret = ircomm_tty_block_til_ready(self, filp);
 	if (ret) {
-		/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
 		IRDA_DEBUG(2, 
 		      "%s(), returning after block_til_ready with %d\n", __FUNCTION__ ,
 		      ret);
@@ -503,7 +499,6 @@ static void ircomm_tty_close(struct tty_
 	spin_lock_irqsave(&self->spinlock, flags);
 
 	if (tty_hung_up_p(filp)) {
-		MOD_DEC_USE_COUNT;
 		spin_unlock_irqrestore(&self->spinlock, flags);
 
 		IRDA_DEBUG(0, "%s(), returning 1\n", __FUNCTION__ );
@@ -530,7 +525,6 @@ static void ircomm_tty_close(struct tty_
 		self->open_count = 0;
 	}
 	if (self->open_count) {
-		MOD_DEC_USE_COUNT;
 		spin_unlock_irqrestore(&self->spinlock, flags);
 
 		IRDA_DEBUG(0, "%s(), open count > 0\n", __FUNCTION__ );
@@ -572,8 +566,6 @@ static void ircomm_tty_close(struct tty_
 
 	self->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&self->close_wait);
-
-	MOD_DEC_USE_COUNT;
 }
 
 /*

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

end of thread, other threads:[~2003-08-11 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-08 18:55 [PATCH 2.5 IrDA] IrCOMM module fix Jean Tourrilhes
2003-08-11 21:02 Jean Tourrilhes

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®