diff options
author | Jinyoung Park <jinyoungp@nvidia.com> | 2013-05-02 20:56:05 +0900 |
---|---|---|
committer | Harry Hong <hhong@nvidia.com> | 2014-01-12 16:46:24 -0800 |
commit | 60ac52cc5034515b2de1e1eb9f627d0e92000f06 (patch) | |
tree | 4e7a45e49249d74b1203fb1eb0c4f9144b8e40f6 /drivers | |
parent | 85ba3c70fd78cfb674ca557180325d8ca790a24e (diff) |
drivers: misc: therm_est: Add of_match_table
Added of_match_table in the driver structure.
If there is therm_est binding data in device tree, we don't need to add
platform_device_register() for therm_est device in board file.
Bug 1240803
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/224875
(cherry picked from commit 71deb2ba7174b010c63155a47c54de9a9ea7f7d7)
Change-Id: Ia85a74d3c7b69c3bd4be7859ec8daa8d09d0a4e1
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/353278
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/therm_est.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/misc/therm_est.c b/drivers/misc/therm_est.c index 5918d240c962..c7756461ca32 100644 --- a/drivers/misc/therm_est.c +++ b/drivers/misc/therm_est.c @@ -846,13 +846,12 @@ static int __parse_dt_timer_trip(struct device_node *np, static struct therm_est_data *therm_est_get_pdata(struct device *dev) { struct therm_est_data *data; - struct device_node *np; + struct device_node *np = dev->of_node; struct device_node *ch; u32 val; int i, j, k, l; int ret; - np = of_find_compatible_node(NULL, NULL, "nvidia,therm-est"); if (!np) return dev->platform_data; @@ -1064,10 +1063,19 @@ static void __devexit therm_est_shutdown(struct platform_device *pdev) therm_est_remove(pdev); } +#ifdef CONFIG_OF +static const struct of_device_id therm_est_dt_match[] = { + { .compatible = "nvidia,therm-est" }, + { }, +}; +MODULE_DEVICE_TABLE(of, therm_est_dt_match); +#endif + static struct platform_driver therm_est_driver = { .driver = { .owner = THIS_MODULE, .name = "therm_est", + .of_match_table = of_match_ptr(therm_est_dt_match), }, .probe = therm_est_probe, .remove = __devexit_p(therm_est_remove), |