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 3/7] hvcs: Remove sysfs group earlier
Date: Mon, 30 Jan 2023 16:43:17 -0600 [thread overview]
Message-ID: <20230130224321.164843-4-brking@linux.vnet.ibm.com> (raw)
In-Reply-To: <20230130224321.164843-1-brking@linux.vnet.ibm.com>
Cleanup the sysfs group earlier in remove. This eliminates
errors coming from kernfs when attempting to remove a console
device that is in use.
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 9131dcb2e8d8..9c5887d0c882 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -688,8 +688,6 @@ static void hvcs_destruct_port(struct tty_port *p)
spin_unlock_irqrestore(&hvcsd->lock, flags);
spin_unlock(&hvcs_structs_lock);
- sysfs_remove_group(&vdev->dev.kobj, &hvcs_attr_group);
-
kfree(hvcsd);
}
@@ -814,6 +812,8 @@ static void hvcs_remove(struct vio_dev *dev)
*/
tty_port_put(&hvcsd->port);
+ sysfs_remove_group(&dev->dev.kobj, &hvcs_attr_group);
+
/*
* The hangup is a scheduled function which will auto chain call
* hvcs_hangup. The tty should always be valid at this time unless a
--
2.31.1
next prev parent reply other threads:[~2023-01-30 22:46 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 ` [PATCH 2/7] hvcs: Remove sysfs file prior to vio unregister Brian King
2023-01-30 22:43 ` Brian King [this message]
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-4-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).