diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/power/twl4030_charger.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/power/twl4030_charger.c')
-rw-r--r-- | drivers/power/twl4030_charger.c | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index f141088..d98abe9 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c @@ -495,38 +495,10 @@ static enum power_supply_property twl4030_charger_props[] = { POWER_SUPPLY_PROP_CURRENT_NOW, }; -#ifdef CONFIG_OF -static const struct twl4030_bci_platform_data * -twl4030_bci_parse_dt(struct device *dev) -{ - struct device_node *np = dev->of_node; - struct twl4030_bci_platform_data *pdata; - u32 num; - - if (!np) - return NULL; - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) - return pdata; - - if (of_property_read_u32(np, "ti,bb-uvolt", &num) == 0) - pdata->bb_uvolt = num; - if (of_property_read_u32(np, "ti,bb-uamp", &num) == 0) - pdata->bb_uamp = num; - return pdata; -} -#else -static inline const struct twl4030_bci_platform_data * -twl4030_bci_parse_dt(struct device *dev) -{ - return NULL; -} -#endif - static int __init twl4030_bci_probe(struct platform_device *pdev) { struct twl4030_bci *bci; - const struct twl4030_bci_platform_data *pdata = pdev->dev.platform_data; + struct twl4030_bci_platform_data *pdata = pdev->dev.platform_data; int ret; u32 reg; @@ -534,9 +506,6 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) if (bci == NULL) return -ENOMEM; - if (!pdata) - pdata = twl4030_bci_parse_dt(&pdev->dev); - bci->dev = &pdev->dev; bci->irq_chg = platform_get_irq(pdev, 0); bci->irq_bci = platform_get_irq(pdev, 1); @@ -612,11 +581,8 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) twl4030_charger_enable_ac(true); twl4030_charger_enable_usb(bci, true); - if (pdata) - twl4030_charger_enable_backup(pdata->bb_uvolt, - pdata->bb_uamp); - else - twl4030_charger_enable_backup(0, 0); + twl4030_charger_enable_backup(pdata->bb_uvolt, + pdata->bb_uamp); return 0; @@ -665,17 +631,10 @@ static int __exit twl4030_bci_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id twl_bci_of_match[] = { - {.compatible = "ti,twl4030-bci", }, - { } -}; -MODULE_DEVICE_TABLE(of, twl_bci_of_match); - static struct platform_driver twl4030_bci_driver = { .driver = { .name = "twl4030_bci", .owner = THIS_MODULE, - .of_match_table = of_match_ptr(twl_bci_of_match), }, .remove = __exit_p(twl4030_bci_remove), }; |