From: Magnus Damm <magnus.damm@gmail.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: Greg KH <gregkh@suse.de>, damm@igel.co.jp, linux-kernel@vger.kernel.org
Subject: Re: early platform drivers vs resource lookup by name
Date: Wed, 29 Jul 2009 00:03:00 +0900 [thread overview]
Message-ID: <aec7e5c30907280803u5e0fe465gb703dd1926f1724c@mail.gmail.com> (raw)
In-Reply-To: <8bd0f97a0907262320y3c5c3505h5d47d5c51025a536@mail.gmail.com>
Hi Mike,
On Mon, Jul 27, 2009 at 3:20 PM, Mike Frysinger<vapier.adi@gmail.com> wrote:
> ive been toying with the new early platform driver framework and
> noticed a not-so-friendly feature wrt resource handling. the
> platform_device_add() function will take care of making sure that
> every resource's name field is not NULL:
> int platform_device_add(struct platform_device *pdev)
> {
> ...
> if (r->name == NULL)
> r->name = dev_name(&pdev->dev);
> ...
>
> unfortunately, the early_platform_add_devices() function does not have
> similar code. this leads to NULL pointer crashes if you attempt to
> use any of the "byname" resource functions (e.g.
> platform_get_resource_byname) and the resources in question arent
> fully named.
>
> is the simple fix here to add a resource loop to
> early_platform_add_devices() that makes sure all the name fields are
> non-NULL ?
I'm not aware of any available fix for this. I'm all for improving the
code as long as we don't add too many dependencies that prevents the
code from working very early on during the boot. Making it depend on
kmalloc() is for instance a bad idea. The early platform SuperH
drivers that I've hacked up do not use "byname" so this has not been
an issue for me so far
Please CC me on this address for future patches. =)
Cheers,
/ magnus
prev parent reply other threads:[~2009-07-28 15:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-27 6:20 Mike Frysinger
2009-07-27 17:48 ` Greg KH
2009-07-27 18:13 ` Mike Frysinger
2009-07-28 15:03 ` Magnus Damm [this message]
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=aec7e5c30907280803u5e0fe465gb703dd1926f1724c@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=damm@igel.co.jp \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=vapier.adi@gmail.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
all inboxes | Powered by JetHome®