Skip to content

Commit

Permalink
driver core: Early dev_name() depends on slab_is_available().
Browse files Browse the repository at this point in the history
The early dev_name() setup needs to do an allocation which can only be
satisfied under slab_is_available() conditions. Some of the early
platform drivers may be initialized before this point, and those still
need to contend themselves with an empty dev_name.

This fixes up a regression with the SH earlyprintk which was bailing out
prior to hitting the early probe path due to not being able to satisfy
the early allocation. Other early platform drivers (such as the early
timers) that need to match the dev name are sufficiently late that
allocations are already possible.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed May 13, 2010
1 parent bd05086 commit 06fe53b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ static int __init early_platform_driver_probe_id(char *class_str,
* dev_name() and others to be used before the
* rest of the driver core is initialized.
*/
if (!match->dev.init_name) {
if (!match->dev.init_name && slab_is_available()) {
if (match->id != -1)
match->dev.init_name =
kasprintf(GFP_KERNEL, "%s.%d",
Expand Down

0 comments on commit 06fe53b

Please sign in to comment.