]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/platform.c
platform: prefix MODALIAS with "platform:"
[karo-tx-linux.git] / drivers / base / platform.c
index 17b5ece8f82cf647c8bf4fad6b632bbb9ab33a3e..9bfc434d132734c759fcfabac43cc11b3835f994 100644 (file)
@@ -349,8 +349,15 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
  *     This function creates a simple platform device that requires minimal
  *     resource and memory management. Canned release function freeing
  *     memory allocated for the device allows drivers using such devices
- *     to be unloaded iwithout waiting for the last reference to the device
+ *     to be unloaded without waiting for the last reference to the device
  *     to be dropped.
+ *
+ *     This interface is primarily intended for use with legacy drivers
+ *     which probe hardware directly.  Because such drivers create sysfs
+ *     device nodes themselves, rather than letting system infrastructure
+ *     handle such device enumeration tasks, they don't fully conform to
+ *     the Linux driver model.  In particular, when such drivers are built
+ *     as modules, they can't be "hotplugged".
  */
 struct platform_device *platform_device_register_simple(char *name, unsigned int id,
                                                        struct resource *res, unsigned int num)
@@ -512,7 +519,7 @@ static ssize_t
 modalias_show(struct device *dev, struct device_attribute *a, char *buf)
 {
        struct platform_device  *pdev = to_platform_device(dev);
-       int len = snprintf(buf, PAGE_SIZE, "%s\n", pdev->name);
+       int len = snprintf(buf, PAGE_SIZE, "platform:%s\n", pdev->name);
 
        return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
@@ -528,7 +535,7 @@ static int platform_uevent(struct device *dev, char **envp, int num_envp,
        struct platform_device  *pdev = to_platform_device(dev);
 
        envp[0] = buffer;
-       snprintf(buffer, buffer_size, "MODALIAS=%s", pdev->name);
+       snprintf(buffer, buffer_size, "MODALIAS=platform:%s", pdev->name);
        return 0;
 }