LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Robert Crocombe <rcrocomb@gmail.com>
Cc: linux1394-devel <linux1394-devel@lists.sourceforge.net>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH update] ieee1394: fix host device registering when nodemgr disabled
Date: Tue, 6 Feb 2007 02:20:06 +0100 (CET) [thread overview]
Message-ID: <tkrat.e12859f4e3703b6b@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.064c609db01a3918@s5r6.in-berlin.de>
Since my commit 8252bbb1363b7fe963a3eb6f8a36da619a6f5a65 in 2.6.20-rc1,
host devices have a dummy driver attached. Alas the driver was not
registered before use if ieee1394 was loaded with disable_nodemgr=1.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
Update: - work without extern variables,
- better error checks,
- add missing driver_unregister.
drivers/ieee1394/nodemgr.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
Index: linux-2.6.20-rc5/drivers/ieee1394/nodemgr.c
===================================================================
--- linux-2.6.20-rc5.orig/drivers/ieee1394/nodemgr.c
+++ linux-2.6.20-rc5/drivers/ieee1394/nodemgr.c
@@ -258,7 +258,6 @@ static struct device_driver nodemgr_mid_
struct device nodemgr_dev_template_host = {
.bus = &ieee1394_bus_type,
.release = nodemgr_release_host,
- .driver = &nodemgr_mid_layer_driver,
};
@@ -1850,22 +1849,33 @@ int init_ieee1394_nodemgr(void)
error = class_register(&nodemgr_ne_class);
if (error)
- return error;
-
+ goto fail_ne;
error = class_register(&nodemgr_ud_class);
- if (error) {
- class_unregister(&nodemgr_ne_class);
- return error;
- }
+ if (error)
+ goto fail_ud;
+
+ /* don't show this driver if nodemgr is off (disable_nodmgr=1) */
+ nodemgr_dev_template_host.driver = &nodemgr_mid_layer_driver;
+
error = driver_register(&nodemgr_mid_layer_driver);
+ if (error)
+ goto fail_ml;
+
hpsb_register_highlevel(&nodemgr_highlevel);
return 0;
+
+fail_ml:
+ class_unregister(&nodemgr_ud_class);
+fail_ud:
+ class_unregister(&nodemgr_ne_class);
+fail_ne:
+ return error;
}
void cleanup_ieee1394_nodemgr(void)
{
hpsb_unregister_highlevel(&nodemgr_highlevel);
-
+ driver_unregister(&nodemgr_mid_layer_driver);
class_unregister(&nodemgr_ud_class);
class_unregister(&nodemgr_ne_class);
}
--
Stefan Richter
-=====-=-=== --=- --==-
http://arcgraph.de/sr/
next prev parent reply other threads:[~2007-02-06 1:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-05 23:21 ohci1394 broke 2.6.19 -> 2.6.20-rc1 Robert Crocombe
2007-02-06 0:03 ` Stefan Richter
2007-02-06 0:39 ` Stefan Richter
2007-02-06 0:48 ` Stefan Richter
2007-02-06 1:20 ` Stefan Richter [this message]
2007-02-06 1:04 ` Robert Crocombe
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=tkrat.e12859f4e3703b6b@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=rcrocomb@gmail.com \
--subject='Re: [PATCH update] ieee1394: fix host device registering when nodemgr disabled' \
/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
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).