aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/tps65090-charger.c
diff options
context:
space:
mode:
authorRhyland Klein <rklein@nvidia.com>2013-03-21 16:33:05 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-04-01 02:15:47 -0400
commit594f8f888d325591851f419c22e0349263214eff (patch)
treeb876a7ccb0ceaf6d7f0edf1b51a0dd275761c770 /drivers/power/tps65090-charger.c
parent6b24c9cb7d57a41f2ff193bcfcc2e1976bb4bbac (diff)
tps65090: Setup compatible property for dt
Setup the compatible property so that when this device is registered through device tree, it can match the expected compatiblity string used in the tps65090 driver. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power/tps65090-charger.c')
-rw-r--r--drivers/power/tps65090-charger.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index 0c66c6656b13..9fbca310a2ad 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -168,7 +168,7 @@ static struct tps65090_platform_data *
168 tps65090_parse_dt_charger_data(struct platform_device *pdev) 168 tps65090_parse_dt_charger_data(struct platform_device *pdev)
169{ 169{
170 struct tps65090_platform_data *pdata; 170 struct tps65090_platform_data *pdata;
171 struct device_node *np = pdev->dev.parent->of_node; 171 struct device_node *np = pdev->dev.of_node;
172 unsigned int prop; 172 unsigned int prop;
173 173
174 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 174 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
@@ -195,7 +195,6 @@ static struct tps65090_platform_data *
195 195
196static int tps65090_charger_probe(struct platform_device *pdev) 196static int tps65090_charger_probe(struct platform_device *pdev)
197{ 197{
198 struct tps65090 *tps65090_mfd = dev_get_drvdata(pdev->dev.parent);
199 struct tps65090_charger *cdata; 198 struct tps65090_charger *cdata;
200 struct tps65090_platform_data *pdata; 199 struct tps65090_platform_data *pdata;
201 uint8_t status1 = 0; 200 uint8_t status1 = 0;
@@ -204,7 +203,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
204 203
205 pdata = dev_get_platdata(pdev->dev.parent); 204 pdata = dev_get_platdata(pdev->dev.parent);
206 205
207 if (!pdata && tps65090_mfd->dev->of_node) 206 if (!pdata && pdev->dev.of_node)
208 pdata = tps65090_parse_dt_charger_data(pdev); 207 pdata = tps65090_parse_dt_charger_data(pdev);
209 208
210 if (!pdata) { 209 if (!pdata) {
@@ -300,9 +299,15 @@ static int tps65090_charger_remove(struct platform_device *pdev)
300 return 0; 299 return 0;
301} 300}
302 301
302static struct of_device_id of_tps65090_charger_match[] = {
303 { .compatible = "ti,tps65090-charger", },
304 { /* end */ }
305};
306
303static struct platform_driver tps65090_charger_driver = { 307static struct platform_driver tps65090_charger_driver = {
304 .driver = { 308 .driver = {
305 .name = "tps65090-charger", 309 .name = "tps65090-charger",
310 .of_match_table = of_tps65090_charger_match,
306 .owner = THIS_MODULE, 311 .owner = THIS_MODULE,
307 }, 312 },
308 .probe = tps65090_charger_probe, 313 .probe = tps65090_charger_probe,