mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Waitz <tali@admingilde.org>
To: Patrick Mochel <mochel@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: device interface api
Date: Wed, 18 Dec 2002 01:40:39 +0100	[thread overview]
Message-ID: <20021218004039.GA1115@admingilde.org> (raw)

[-- 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 --]

             reply	other threads:[~2002-12-18  0:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18  0:40 Martin Waitz [this message]
2002-12-19 19:31 ` Patrick Mochel

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=20021218004039.GA1115@admingilde.org \
    --to=tali@admingilde.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    /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®