early platform drivers vs resource lookup by name

From: Mike Frysinger
Date: Mon Jul 27 2009 - 02:20:33 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/