From: Kay Sievers <kay.sievers@vrfy.org>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Greg KH <greg@kroah.com>, Magnus Damm <damm@opensource.se>,
linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] driver core: Early dev_name() support.
Date: Thu, 11 Mar 2010 20:59:18 +0100 [thread overview]
Message-ID: <ac3eb2511003111159q84e6cefi43de106c79c0e333@mail.gmail.com> (raw)
In-Reply-To: <20100309065753.GA8287@linux-sh.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1877 bytes --]
On Tue, Mar 9, 2010 at 07:57, Paul Mundt <lethal@linux-sh.org> wrote:> This implements early init_name construction from the matched name/id> pair following the semantics of the late device/driver match. As a> result, matched IDs (inclusive of requested ones) are preserved when the> handoff from the early platform code happens at kobject initialization> time.
> + Â Â Â Â Â Â Â Â Â Â Â if (!match->dev.init_name) {> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â char buf[32];> +> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (match->id != -1)> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â snprintf(buf, sizeof(buf), "%s.%d",> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â match->name, match->id);> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â else> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â snprintf(buf, sizeof(buf), "%s",> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â match->name);> +> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â match->dev.init_name = kstrdup(buf, GFP_KERNEL);> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (!match->dev.init_name)> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return -ENOMEM;> + Â Â Â Â Â Â Â Â Â Â Â }
This can be kasprintf() I guess.
> Â static inline const char *dev_name(const struct device *dev)> Â {> + Â Â Â /* Use the init name until the kobject becomes available */
This should probably state that it's used for getting names out ofunregistered devices. Otherwise it sounds confusing.
> + Â Â Â if (dev->init_name)> + Â Â Â Â Â Â Â return dev->init_name;> +> Â Â Â Â return kobject_name(&dev->kobj);> Â }
Thanks,Kayÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2010-03-11 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 6:57 [PATCH] driver core: Early dev_name() support Paul Mundt
2010-03-10 2:37 ` Greg KH
2010-03-10 3:21 ` Paul Mundt
2010-03-10 3:28 ` Greg KH
2010-03-10 4:10 ` Paul Mundt
2010-03-11 19:59 ` Kay Sievers [this message]
2010-03-15 8:03 ` Paul Mundt
2010-03-15 11:29 ` Kay Sievers
2010-03-15 11:56 ` Paul Mundt
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=ac3eb2511003111159q84e6cefi43de106c79c0e333@mail.gmail.com \
--to=kay.sievers@vrfy.org \
--cc=damm@opensource.se \
--cc=greg@kroah.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).