Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/rtc/rtc-em3027.c: add device tree support

Set the of_match_table for this driver so that devices can be described in
the device tree. This device is used in the Trimslice and is already
defined in the Trimslice device tree.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Robinson and committed by
Linus Torvalds
e706974d 7f48b21b

+11
+11
drivers/rtc/rtc-em3027.c
··· 15 15 #include <linux/rtc.h> 16 16 #include <linux/bcd.h> 17 17 #include <linux/module.h> 18 + #include <linux/of.h> 18 19 19 20 /* Registers */ 20 21 #define EM3027_REG_ON_OFF_CTRL 0x00 ··· 136 135 { "em3027", 0 }, 137 136 { } 138 137 }; 138 + MODULE_DEVICE_TABLE(i2c, em3027_id); 139 + 140 + #ifdef CONFIG_OF 141 + static const struct of_device_id em3027_of_match[] = { 142 + { .compatible = "emmicro,em3027", }, 143 + {} 144 + }; 145 + MODULE_DEVICE_TABLE(of, em3027_of_match); 146 + #endif 139 147 140 148 static struct i2c_driver em3027_driver = { 141 149 .driver = { 142 150 .name = "rtc-em3027", 151 + .of_match_table = of_match_ptr(em3027_of_match), 143 152 }, 144 153 .probe = &em3027_probe, 145 154 .id_table = em3027_id,