]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
platform/chrome: cros_ec_dev - Add a platform device ID table
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Mon, 22 Jun 2015 06:27:20 +0000 (08:27 +0200)
committerOlof Johansson <olof@lixom.net>
Wed, 7 Oct 2015 21:34:26 +0000 (14:34 -0700)
If the cros_ec_dev driver is built as a module, modalias information is
not filled so the module is not autoloaded. Add a platform device table
and use the MODULE_DEVICE_TABLE() macro to export that information in
the module so user-space can match the modalias uevent and autoload it.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/platform/chrome/cros_ec_dev.c

index e8fcdc237029a97908194a52b668ad0c4aa6920c..2f409982048056f231b4cfd86f0a86b6f312cb4a 100644 (file)
@@ -287,6 +287,12 @@ static int ec_device_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct platform_device_id cros_ec_id[] = {
+       { "cros-ec-ctl", 0 },
+       { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_id);
+
 static struct platform_driver cros_ec_dev_driver = {
        .driver = {
                .name = "cros-ec-ctl",