linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: "Cousson, Benoit" <b-cousson@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"paul@pwsan.com" <paul@pwsan.com>,
	"grant.likely@secretlab.ca" <grant.likely@secretlab.ca>
Subject: Re: [RFC PATCH 1/3] OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration
Date: Fri, 02 Sep 2011 09:20:05 -0700	[thread overview]
Message-ID: <87vcta9aru.fsf@ti.com> (raw)
In-Reply-To: <4E60F4C6.2050802@ti.com> (Benoit Cousson's message of "Fri, 2 Sep 2011 17:22:46 +0200")

"Cousson, Benoit" <b-cousson@ti.com> writes:

[...]

>>> @@ -471,72 +572,31 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
>>>   		goto odbs_exit;
>>>   	}
>>>
>>> -	pr_debug("omap_device: %s: building with %d hwmods\n", pdev_name,
>>> -		 oh_cnt);
>>> +	/* Set the dev_name early to allow dev_xxx in omap_device_alloc */
>>> +	if (pdev->id != -1)
>>> +		dev_set_name(&pdev->dev, "%s.%d", pdev->name,  pdev->id);
>>> +	else
>>> +		dev_set_name(&pdev->dev, "%s", pdev->name);
>> 
>> Minor: I think setting dev->init_name is more appropriate here, and
>> should have the same effect.
>
> The slight difference is that if I do that:
> pdev->dev.init_name = kasprintf(GFP_KERNEL, "%s.%d", pdev->name, pdev->id);
>
> I will have to free it myself, because device_add is doing only that:
>
>         if (dev->init_name) {
>                 dev_set_name(dev, "%s", dev->init_name);
>                 dev->init_name = NULL;
>         }
>
> Whereas dev_set_name is doing it for me.
>
> So it will add one more line later. Does it worth it?

OK, keeping dev_set_name() is fine with me then.

Kevin

  reply	other threads:[~2011-09-02 16:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 18:22 [RFC PATCH 0/3] OMAP: omap_device: Add a method to build an omap_device from a DT node Benoit Cousson
2011-08-22 18:22 ` [RFC PATCH 1/3] OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration Benoit Cousson
2011-09-01 18:30   ` Kevin Hilman
2011-09-02 15:22     ` Cousson, Benoit
2011-09-02 16:20       ` Kevin Hilman [this message]
2011-08-22 18:22 ` [RFC PATCH 2/3] OMAP: omap_device: Add a DT parser for multiple strings Benoit Cousson
2011-09-01 18:38   ` Kevin Hilman
2011-09-02 15:32     ` Cousson, Benoit
2011-08-22 18:22 ` [RFC PATCH 3/3] OMAP: omap_device: Add a method to build an omap_device from a DT node Benoit Cousson
2011-08-30 13:31   ` Cousson, Benoit
2011-09-01 23:40   ` Kevin Hilman
2011-09-02 15:35     ` Cousson, Benoit

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=87vcta9aru.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=b-cousson@ti.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.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;
as well as URLs for NNTP newsgroup(s).