Skip to contentSkip to conversation

tty: nozomi: change tty_unregister_device to tty_port_unregister_device

PATCH Superseded Dongliang Mu 2 participants 3 messages Jul 20, 2021 – Jul 21, 2021 TTY layer and serial drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: nozomi: change tty_unregister_device to tty_port_unregister_device

The pairwise api invocation of tty_port_register_device should be tty_port_unregister_device, other than tty_unregister_device.

---
 drivers/tty/nozomi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/nozomi.c +2 -1
index 0c80f25c8c3d..08bdd82f60b5 100644
@@ -1417,7 +1417,8 @@ static int nozomi_card_init(struct pci_dev *pdev,
 
 err_free_tty:
 	for (i--; i >= 0; i--) {
-		tty_unregister_device(ntty_driver, dc->index_start + i);
+		tty_port_unregister_device(&dc->port[i].port, ntty_driver,
+				dc->index_start + i);
 		tty_port_destroy(&dc->port[i].port);
 	}
 	free_irq(pdev->irq, dc);
Signature · 1 line
2.25.1
#1 lore raw
Quoted 25 lines · Dongliang Mu

The pairwise api invocation of tty_port_register_device should be tty_port_unregister_device, other than tty_unregister_device.

---
 drivers/tty/nozomi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/nozomi.c +2 -1
index 0c80f25c8c3d..08bdd82f60b5 100644
@@ -1417,7 +1417,8 @@ static int nozomi_card_init(struct pci_dev *pdev,
 
 err_free_tty:
 	for (i--; i >= 0; i--) {
-		tty_unregister_device(ntty_driver, dc->index_start + i);
+		tty_port_unregister_device(&dc->port[i].port, ntty_driver,
+				dc->index_start + i);
 		tty_port_destroy(&dc->port[i].port);
 	}
 	free_irq(pdev->irq, dc);
Signature · 1 line
2.25.1

What commit does this fix? Should it go to stable kernels? Can you please resend it with that information?

And how did you find this?

thanks,

greg k-h

#2 lore raw
Quoted 16 lines · Greg Kroah-Hartman
Quoted 14 lines · Dongliang Mu

The pairwise api invocation of tty_port_register_device should be tty_port_unregister_device, other than tty_unregister_device.

---
 drivers/tty/nozomi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/nozomi.c +0 -0
index 0c80f25c8c3d..08bdd82f60b5 100644
@@ -1417,7 +1417,8 @@ static int nozomi_card_init(struct pci_dev *pdev,
 
Quoted 14 lines
Quoted 11 lines
drivers/tty/nozomi.c +2 -2
 err_free_tty:
      for (i--; i >= 0; i--) {
-             tty_unregister_device(ntty_driver, dc->index_start + i);
+             tty_port_unregister_device(&dc->port[i].port, ntty_driver,
+                             dc->index_start + i);
              tty_port_destroy(&dc->port[i].port);
      }
      free_irq(pdev->irq, dc);
--

2.25.1

What commit does this fix? Should it go to stable kernels? Can you please resend it with that information?

I have sent a v2 patch.

Quoted 2 lines

And how did you find this?

Just by manual code review when checking a fix commit.

Quoted 4 lines

thanks,

greg k-h