linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Brian King <brking@linux.vnet.ibm.com>,
	mmc@linux.vnet.ibm.com, brking@pobox.com
Subject: [PATCH 2/7] hvcs: Remove sysfs file prior to vio unregister
Date: Mon, 30 Jan 2023 16:43:16 -0600	[thread overview]
Message-ID: <20230130224321.164843-3-brking@linux.vnet.ibm.com> (raw)
In-Reply-To: <20230130224321.164843-1-brking@linux.vnet.ibm.com>

This moves the removal of the rescan sysfs attribute to occur
before the call to unregister the vio to ensure the removal
does not fail due to the vio driver already being freed.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
 drivers/tty/hvc/hvcs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index faf5ccfc561e..9131dcb2e8d8 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -1519,6 +1519,8 @@ static int __init hvcs_module_init(void)
 
 static void __exit hvcs_module_exit(void)
 {
+	driver_remove_file(&hvcs_vio_driver.driver, &driver_attr_rescan);
+
 	/*
 	 * This driver receives hvcs_remove callbacks for each device upon
 	 * module removal.
@@ -1538,8 +1540,6 @@ static void __exit hvcs_module_exit(void)
 	hvcs_pi_buff = NULL;
 	spin_unlock(&hvcs_pi_lock);
 
-	driver_remove_file(&hvcs_vio_driver.driver, &driver_attr_rescan);
-
 	tty_unregister_driver(hvcs_tty_driver);
 
 	hvcs_free_index_list();
-- 
2.31.1


  parent reply	other threads:[~2023-01-30 22:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 22:43 [PATCH 0/7] hvcs: Various hvcs device hotplug fixes Brian King
2023-01-30 22:43 ` [PATCH 1/7] hvcs: Fix hvcs port reference counting Brian King
2023-01-30 22:43 ` Brian King [this message]
2023-01-30 22:43 ` [PATCH 3/7] hvcs: Remove sysfs group earlier Brian King
2023-01-30 22:43 ` [PATCH 4/7] hvcs: Get reference to tty in remove Brian King
2023-01-30 22:43 ` [PATCH 5/7] hvcs: Use vhangup in hotplug remove Brian King
2023-01-30 22:43 ` [PATCH 6/7] hvcs: Synchronize hotplug remove with port free Brian King
2023-01-30 22:43 ` [PATCH 7/7] powerpc: Fix device node refcounting Brian King
2023-02-01 10:32 ` [PATCH 0/7] hvcs: Various hvcs device hotplug fixes Christophe Leroy
2023-02-01 15:09   ` Brian King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230130224321.164843-3-brking@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=brking@pobox.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mmc@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).