All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kobj_to_dev ?
Date: Mon, 19 Jan 2004 16:53:39 -0800	[thread overview]
Message-ID: <20040120005338.GA5954@kroah.com> (raw)
In-Reply-To: <1DFA0D5A-4ADF-11D8-B557-000A95A0560C@us.ibm.com>

On Mon, Jan 19, 2004 at 06:25:14PM -0600, Hollis Blanchard wrote:
> 
> On Jan 19, 2004, at 6:04 PM, Greg KH wrote:
> 
> >On Mon, Jan 19, 2004 at 02:26:47PM -0600, Hollis Blanchard wrote:
> >>Greg KH wrote:
> >>>
> >>>How about just adding a find_device() function to the driver core, 
> >>>where
> >>>you pass in a name and a type, so that others can use it?
> >>
> >>Something like this?
> >
> >Very nice, yes.  But I'll rename it to device_find() to keep the
> >namespace sane.  Sound ok?
> 
> Sure. I'm having a problem inside kset_find_obj() when actually using 
> it though, and I'm not sure if it's my fault or not. It seems there are 
> kobjects present for which kobject_name() returns NULL.

Hm, we should probably fix that oops up too.  I'll go do that.

> kset_find_obj:
> 	list_for_each(entry,&kset->list) {
> 		struct kobject * k = to_kobj(entry);
> 		if (!strcmp(kobject_name(k),name)) {
> 			ret = k;
> 			break;
> 		}
> 	}
> 
> where "kset" above is "&my_bus_type.devices". strcmp doesn't like NULL 
> and panics. I've registered 11 devices in my_bus_type, and all of them 
> have names (device_add() makes sure of that).
> 
> Does this sound like my fault?

I don't know.  If you enable debugging for kobjects (in kobject.c) do
you see any kobjects getting added to your bus with no name?

thanks,

greg k-h

  reply	other threads:[~2004-01-20  0:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-16 23:32 kobj_to_dev ? Hollis Blanchard
2004-01-17  0:17 ` Greg KH
2004-01-19 20:26   ` Hollis Blanchard
2004-01-20  0:04     ` Greg KH
2004-01-20  0:25       ` Hollis Blanchard
2004-01-20  0:53         ` Greg KH [this message]
2004-01-20  3:18           ` Hollis Blanchard

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=20040120005338.GA5954@kroah.com \
    --to=greg@kroah.com \
    --cc=hollisb@us.ibm.com \
    --cc=linux-kernel@vger.kernel.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 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.