mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* early platform drivers vs resource lookup by name
@ 2009-07-27  6:20 Mike Frysinger
  2009-07-27 17:48 ` Greg KH
  2009-07-28 15:03 ` Magnus Damm
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Frysinger @ 2009-07-27  6:20 UTC (permalink / raw)
  To: Greg KH, damm; +Cc: linux-kernel

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 ?
-mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-28 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27  6:20 early platform drivers vs resource lookup by name Mike Frysinger
2009-07-27 17:48 ` Greg KH
2009-07-27 18:13   ` Mike Frysinger
2009-07-28 15:03 ` Magnus Damm

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®