From: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>
To: Andrew Morton <akpm@osdl.org>
Cc: Jeff Dike <jdike@addtoit.com>,
linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net
Subject: [PATCH 1/9] uml: avoid sysfs warning on hot-unplug
Date: Wed, 18 Jan 2006 01:19:21 +0100 [thread overview]
Message-ID: <20060118001920.14622.79573.stgit@zion.home.lan> (raw)
In-Reply-To: <20060117235659.14622.18544.stgit@zion.home.lan>
From: Jeff Dike <jdike@addtoit.com>, Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Define a release method for the ubd and network driver so that sysfs doesn't
complain when one is removed via:
host $ uml_mconsole <umid> remove <dev>
Done by Jeff around January for ubd only, later lost, then restored in his tree
- however I'm merging it now since there's no reason to leave this here.
We don't need to do any cleanup in the new added method, because when hot-unplug
is done by uml_mconsole we already handle cleanup in mconsole infrastructure,
i.e. mc_device->remove (net_remove/ubd_remove), which is also the calling
method.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
arch/um/drivers/net_kern.c | 6 ++++++
arch/um/drivers/ubd_kern.c | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index fb1f9fb..5b8c64e 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -276,6 +276,11 @@ static struct platform_driver uml_net_dr
};
static int driver_registered;
+/* Sysfs requires a ->release when mconsole hot-unplug is done */
+static void dummy_device_release(struct device *dev)
+{
+}
+
static int eth_configure(int n, void *init, char *mac,
struct transport *transport)
{
@@ -324,6 +329,7 @@ static int eth_configure(int n, void *in
}
device->pdev.id = n;
device->pdev.name = DRIVER_NAME;
+ device->pdev.dev.release = dummy_device_release;
platform_device_register(&device->pdev);
SET_NETDEV_DEV(dev,&device->pdev.dev);
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 7696f8d..49dda56 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -617,6 +617,11 @@ static int ubd_open_dev(struct ubd *dev)
return(err);
}
+/* Sysfs requires a ->release when mconsole hot-unplug is done */
+static void dummy_device_release(struct device *dev)
+{
+}
+
static int ubd_new_disk(int major, u64 size, int unit,
struct gendisk **disk_out)
@@ -652,6 +657,7 @@ static int ubd_new_disk(int major, u64 s
if (major == MAJOR_NR) {
ubd_dev[unit].pdev.id = unit;
ubd_dev[unit].pdev.name = DRIVER_NAME;
+ ubd_dev[unit].pdev.dev.release = dummy_device_release;
platform_device_register(&ubd_dev[unit].pdev);
disk->driverfs_dev = &ubd_dev[unit].pdev.dev;
}
next parent reply other threads:[~2006-01-18 0:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060117235659.14622.18544.stgit@zion.home.lan>
2006-01-18 0:19 ` Paolo 'Blaisorblade' Giarrusso [this message]
2006-01-18 2:53 ` Jeff Dike
2006-01-18 11:11 ` Blaisorblade
2006-01-18 0:19 ` [PATCH 2/9] uml: make daemon transport behave properly Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:19 ` [PATCH 3/9] uml: networking - clear transport-specific structure Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:19 ` [PATCH 4/9] uml: fix spinlock recursion and sleep-inside-spinlock in error path Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:52 ` Andrew Morton
2006-01-18 11:44 ` [uml-devel] " Blaisorblade
2006-01-18 0:19 ` [PATCH 5/9] uml: sigio code - reduce spinlock hold time Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:19 ` [PATCH 6/9] uml: avoid malloc to sleep in atomic sections Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:56 ` Andrew Morton
2006-01-18 11:47 ` Blaisorblade
2006-01-18 0:19 ` [PATCH 7/9] uml: arch Kconfig menu cleanups Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:19 ` [PATCH 8/9] uml: allow again to move backing file and to override saved location Paolo 'Blaisorblade' Giarrusso
2006-01-18 0:19 ` [PATCH 9/9] uml ubd code: fix a bit of whitespace Paolo 'Blaisorblade' Giarrusso
2006-01-18 1:12 [PATCH 1/9] uml: avoid sysfs warning on hot-unplug Greg KH
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=20060118001920.14622.79573.stgit@zion.home.lan \
--to=blaisorblade@yahoo.it \
--cc=akpm@osdl.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®