All of lore.kernel.org
 help / color / mirror / Atom feed
* device interface api
@ 2002-12-18  0:40 Martin Waitz
  2002-12-19 19:31 ` Patrick Mochel
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Waitz @ 2002-12-18  0:40 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

hi :)

please have a look at interface_add_data:


int interface_add_data(struct intf_data * data)
{
	struct device_interface * intf = intf_from_data(data);

	data->intf_num = data->intf->devnum++;
	data->kobj.subsys = &intf->subsys;
	kobject_register(&data->kobj);
	[...]


data->kobj.subsys is initialized here, but intf_from_data
is using this data->kobj.subsys to get intf, instead of data->intf.
do you want to remove data->intf?
either way, interface_add_data should change.

are interface users supposed to set data->intf or data->kobj.subsys?



another small glitch i noticed while diggin in the code:

================================================================
--- linux-2.5/lib/kobject.c  Tue Dec 10 12:59:02 2002
+++ linux/lib/kobject.c       Tue Dec 17 13:15:19 2002
@@ -218,7 +218,7 @@ int subsystem_register(struct subsystem 
                s->kobj.parent = &s->parent->kobj;
        pr_debug("subsystem %s: registering, parent: %s\n",
                 s->kobj.name,s->parent ? s->parent->kobj.name : "<none>");
-       return kobject_register(&s->kobj);
+       return kobject_add(&s->kobj);
 }
 
 void subsystem_unregister(struct subsystem * s)
================================================================

subsystem_register first calls subsystem_init, which already
does kobject_init, so a full kobject_register is not needed
(and is in fact bad, as it again increases the refcounter for kobj.subsys)


-- 
CU,		  / Friedrich-Alexander University Erlangen, Germany
Martin Waitz	//  [Tali on IRCnet]  [tali.home.pages.de] _________
______________/// - - - - - - - - - - - - - - - - - - - - ///
dies ist eine manuell generierte mail, sie beinhaltet    //
tippfehler und ist auch ohne grossbuchstaben gueltig.   /
			    -
Wer bereit ist, grundlegende Freiheiten aufzugeben, um sich 
kurzfristige Sicherheit zu verschaffen, der hat weder Freiheit 
noch Sicherheit verdient.
			Benjamin Franklin  (1706 - 1790)

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-19 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18  0:40 device interface api Martin Waitz
2002-12-19 19:31 ` Patrick Mochel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.