public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Patrick Mochel <mochel@digitalimplant.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 1/2] request_firmware without a device
Date: Thu, 25 May 2006 21:06:13 -0700	[thread overview]
Message-ID: <20060526040613.GA5324@kroah.com> (raw)
In-Reply-To: <1148614839.32046.143.camel@sli10-desk.sh.intel.com>

On Fri, May 26, 2006 at 11:40:39AM +0800, Shaohua Li wrote:
> On Thu, 2006-05-25 at 12:24 +0200, Marcel Holtmann wrote:
> > Hi Greg,
> > 
> > > > The patch allows calling request_firmware without a 'struct device'.
> > > > It appears we just need a name here from 'struct device'. I changed it
> > > > to use a kobject as Patrick suggested.
> > > > Next patch will use the new API to request firmware (microcode) for a CPU.
> > > 
> > > But a cpu does have a struct device.  Why not just use that?
> > > 
> > > > +fw_setup_class_device_id(struct class_device *class_dev, struct kobject *kobj)
> > > >  {
> > > >  	/* XXX warning we should watch out for name collisions */
> > > > -	strlcpy(class_dev->class_id, dev->bus_id, BUS_ID_SIZE);
> > > > +	strlcpy(class_dev->class_id, kobj->k_name, BUS_ID_SIZE);
> > > 
> > > There's a function for this, kobject_name(), please never touch k_name
> > > directly.
> > > 
> > > > +EXPORT_SYMBOL(request_firmware_kobj);
> > > 
> > > Ick, if you really want to do this, just fix up all callers of
> > > request_firmware(), there aren't that many of them.
> > > 
> > > But I don't recommend it anyway.
> > 
> > I also disagree with this change at all. The callers of request_firmware
> > should not fiddle around with kobject's to make this work. All of them
> > have their struct device and they should use it.
> So why we need a 'struct device'? I didn't see any point we need it. We
> just need a 'name'.

You need a kobject, as ideally we would have a symlink back to the
"real" kobject.  So far, only "devices" need firmware, that's why it is
that way.

> > So I would propose that we fix the caller and the not request_firmware
> > code. However one option would be calling it with NULL as device
> > argument and it registers itself a dummy device for the operation.
> This doesn't work, as we need a 'name'.
> 
> do we really need to differentiate between sysdev and device anymore. I
> > recall a plan to unify all devices, but I might be wrong.
> I'd like this idea. But it means many works. In addition, a sysdev could
> have multiple drivers, and a 'device' can't to me.

Today a sysdev can have that?  Ick.  Any examples of ones that really
do?

thanks,

greg k-h

  reply	other threads:[~2006-05-26  4:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25  3:50 [PATCH 1/2] request_firmware without a device Shaohua Li
2006-05-25  4:01 ` Greg KH
2006-05-25  4:49   ` Shaohua Li
2006-05-25 10:26     ` Marcel Holtmann
2006-05-25 14:55       ` Greg KH
2006-05-25 10:24   ` Marcel Holtmann
2006-05-26  3:40     ` Shaohua Li
2006-05-26  4:06       ` Greg KH [this message]
2006-05-26  4:41         ` Shaohua Li

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=20060526040613.GA5324@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mochel@digitalimplant.org \
    --cc=shaohua.li@intel.com \
    /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