mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Greg KH <greg@kroah.com>, 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: Fri, 26 May 2006 11:40:39 +0800	[thread overview]
Message-ID: <1148614839.32046.143.camel@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <1148552694.4734.10.camel@localhost>

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'.

> 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.

Thanks,
Shaohua

  reply	other threads:[~2006-05-26  3:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25  3:50 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 [this message]
2006-05-26  4:06       ` Greg KH
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=1148614839.32046.143.camel@sli10-desk.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mochel@digitalimplant.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®