From 1225a61f0aec6bff340e84ac05bd77ba39151884 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 23 Apr 2015 14:35:33 -0700 Subject: [PATCH] init: consider all platform devices for find_platform_device Certain platforms list their platform devices with a path other than the current /devices or /devices/platform. Additionally, sometimes these paths are a platform device themselves. An example are devices with a path /devices/soc.0/... where /devices/soc.0 is also a platform devices. Instead of continuing to special case these path prefixes, we can consider the entire path, given that no mmc or usb devices create platform devices as subdevices, which they should not by their very nature. This keeps the symlinks for block devices named identically for current platform devices and places them in /dev/block/ for devices in locations other than /devices or /devices/platform, eg /dev/block/platform/soc.0/7824900.sdhci This keeps the symlinks for character deviced named identically for all cases. Change-Id: Ifc8eedf1086db1826dbc8f7e96cdfcfa5da876b3 --- init/devices.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/init/devices.cpp b/init/devices.cpp index 96b1696b4..2c7f5a9cd 100644 --- a/init/devices.cpp +++ b/init/devices.cpp @@ -266,7 +266,6 @@ static void make_device(const char *path, static void add_platform_device(const char *path) { int path_len = strlen(path); - struct listnode *node; struct platform_node *bus; const char *name = path; @@ -276,15 +275,6 @@ static void add_platform_device(const char *path) name += 9; } - list_for_each_reverse(node, &platform_names) { - bus = node_to_item(node, struct platform_node, list); - if ((bus->path_len < path_len) && - (path[bus->path_len] == '/') && - !strncmp(path, bus->path, bus->path_len)) - /* subdevice of an existing platform, ignore it */ - return; - } - INFO("adding platform device %s (%s)\n", name, path); bus = (platform_node*) calloc(1, sizeof(struct platform_node));