diff mbox series

[7/7] iio: light: al3320a allow module autoload when defined in dts

Message ID 20200124220346.2655336-7-david@ixit.cz (mailing list archive)
State Superseded
Headers show
Series [1/7] iio: light: al3320a slightly improve code formatting | expand

Commit Message

David Heidelberg Jan. 24, 2020, 10:03 p.m. UTC
- also drop init.h and alphabetically sort

Signed-off-by: David Heidelberg <david@ixit.cz>
---
 drivers/iio/light/al3320a.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c
index d99f9d139b5f..d66c85b27907 100644
--- a/drivers/iio/light/al3320a.c
+++ b/drivers/iio/light/al3320a.c
@@ -12,9 +12,9 @@ 
  * potential races with the interrupt handling.
  */
 
-#include <linux/module.h>
-#include <linux/init.h>
 #include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/of.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -238,9 +238,16 @@  static const struct i2c_device_id al3320a_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, al3320a_id);
 
+static const struct of_device_id al3320a_of_match[] = {
+	{ .compatible = "dynaimage,al3320a", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, al3320a_of_match);
+
 static struct i2c_driver al3320a_driver = {
 	.driver = {
 		.name = AL3320A_DRV_NAME,
+		.of_match_table = al3320a_of_match,
 		.pm = &al3320a_pm_ops,
 	},
 	.probe		= al3320a_probe,