Re: linux-next: manual merge of the driver-core tree with the battery tree
On Thu, Nov 29, 2012 at 03:09:33PM +1100, Stephen Rothwell wrote: > Hi Greg, > > Today's linux-next merge of the driver-core tree got a conflict in > drivers/power/ab8500_btemp.c between commit bd9e8ab2d58d ("ab8500: Add > devicetree support for btemp") from the battery tree and commit > c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. > > I fixed it up (see below) and can carry the fix as necessary (no action > is required). Looks good, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: linux-next: manual merge of the driver-core tree with the battery tree
On Thu, Nov 29, 2012 at 03:11:42PM +1100, Stephen Rothwell wrote: > Hi Greg, > > Today's linux-next merge of the driver-core tree got a conflict in > drivers/power/ab8500_charger.c between commit 4aef72dbb2e8 ("ab8500: Add > devicetree support for charger") from the battery tree and commit > c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. > > I fixed it up (see below) and can carry the fix as necessary (no action > is required). Looks good, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: linux-next: manual merge of the driver-core tree with the battery tree
On Thu, Nov 29, 2012 at 03:15:58PM +1100, Stephen Rothwell wrote: > Hi Greg, > > Today's linux-next merge of the driver-core tree got a conflict in > drivers/power/abx500_chargalg.c between commit a12810ab9fcf ("ab8500: Add > devicetree support for chargalg") from the battery tree and commit > c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. > > I fixed it up (see below) and can carry the fix as necessary (no action > is required). Looks good, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: linux-next: manual merge of the driver-core tree with the battery tree
On Thu, Nov 29, 2012 at 03:13:36PM +1100, Stephen Rothwell wrote: > Hi Greg, > > Today's linux-next merge of the driver-core tree got a conflict in > drivers/power/ab8500_fg.c between commit e0f1abeba5c2 ("ab8500: Add > devicetree support for fuelgauge") from the battery tree and commit > c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. > > I fixed it up (see below) and can carry the fix as necessary (no action > is required). Looks good, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: linux-next: manual merge of the driver-core tree with the battery tree
On Thu, Nov 29, 2012 at 03:20:08PM +1100, Stephen Rothwell wrote: > Hi Greg, > > Today's linux-next merge of the driver-core tree got a conflict in > drivers/power/max8925_power.c between commit eba3b670a916 > ("max8925_power: Add support for device-tree initialization") from the > battery tree and commit c8afa6406e60 ("power: remove use of __devinit") > from the driver-core tree. > > I fixed it up (see below) and can carry the fix as necessary (no action > is required). Looks good, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
linux-next: manual merge of the driver-core tree with the battery tree
Hi Greg, Today's linux-next merge of the driver-core tree got a conflict in drivers/power/max8925_power.c between commit eba3b670a916 ("max8925_power: Add support for device-tree initialization") from the battery tree and commit c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. I fixed it up (see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwells...@canb.auug.org.au diff --cc drivers/power/max8925_power.c index b5a3ccb,1a075f1..000 --- a/drivers/power/max8925_power.c +++ b/drivers/power/max8925_power.c @@@ -427,55 -426,7 +427,55 @@@ static int max8925_deinit_charger(struc return 0; } +#ifdef CONFIG_OF +static struct max8925_power_pdata * +max8925_power_dt_init(struct platform_device *pdev) +{ + struct device_node *nproot = pdev->dev.parent->of_node; + struct device_node *np; + int batt_detect; + int topoff_threshold; + int fast_charge; + int no_temp_support; + int no_insert_detect; + struct max8925_power_pdata *pdata; + + if (!nproot) + return pdev->dev.platform_data; + + np = of_find_node_by_name(nproot, "charger"); + if (!np) { + dev_err(&pdev->dev, "failed to find charger node\n"); + return NULL; + } + + pdata = devm_kzalloc(&pdev->dev, + sizeof(struct max8925_power_pdata), + GFP_KERNEL); + + of_property_read_u32(np, "topoff-threshold", &topoff_threshold); + of_property_read_u32(np, "batt-detect", &batt_detect); + of_property_read_u32(np, "fast-charge", &fast_charge); + of_property_read_u32(np, "no-insert-detect", &no_insert_detect); + of_property_read_u32(np, "no-temp-support", &no_temp_support); + + pdata->batt_detect = batt_detect; + pdata->fast_charge = fast_charge; + pdata->topoff_threshold = topoff_threshold; + pdata->no_insert_detect = no_insert_detect; + pdata->no_temp_support = no_temp_support; + + return pdata; +} +#else +static struct max8925_power_pdata * +max8925_power_dt_init(struct platform_device *pdev) +{ + return pdev->dev.platform_data; +} +#endif + - static __devinit int max8925_power_probe(struct platform_device *pdev) + static int max8925_power_probe(struct platform_device *pdev) { struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); struct max8925_power_pdata *pdata = NULL; pgpvlqHDSQbEU.pgp Description: PGP signature
linux-next: manual merge of the driver-core tree with the battery tree
Hi Greg, Today's linux-next merge of the driver-core tree got a conflict in drivers/power/abx500_chargalg.c between commit a12810ab9fcf ("ab8500: Add devicetree support for chargalg") from the battery tree and commit c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. I fixed it up (see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwells...@canb.auug.org.au diff --cc drivers/power/abx500_chargalg.c index dcdc439,19f2541..000 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@@ -1799,37 -1800,15 +1799,37 @@@ static int abx500_chargalg_remove(struc return 0; } +static char *supply_interface[] = { + "ab8500_fg", +}; + - static int __devinit abx500_chargalg_probe(struct platform_device *pdev) + static int abx500_chargalg_probe(struct platform_device *pdev) { - struct abx500_bm_plat_data *plat_data; + struct device_node *np = pdev->dev.of_node; + struct abx500_chargalg *di; int ret = 0; - struct abx500_chargalg *di = - kzalloc(sizeof(struct abx500_chargalg), GFP_KERNEL); - if (!di) + di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL); + if (!di) { + dev_err(&pdev->dev, "%s no mem for ab8500_chargalg\n", __func__); return -ENOMEM; + } + di->bat = pdev->mfd_cell->platform_data; + if (!di->bat) { + if (np) { + ret = bmdevs_of_probe(&pdev->dev, np, &di->bat); + if (ret) { + dev_err(&pdev->dev, + "failed to get battery information\n"); + return ret; + } + } else { + dev_err(&pdev->dev, "missing dt node for ab8500_chargalg\n"); + return -EINVAL; + } + } else { + dev_info(&pdev->dev, "falling back to legacy platform data\n"); + } /* get device struct */ di->dev = &pdev->dev; @@@ -1905,14 -1888,12 +1905,14 @@@ free_chargalg_wq return ret; } +static const struct of_device_id ab8500_chargalg_match[] = { + { .compatible = "stericsson,ab8500-chargalg", }, + { }, +}; + static struct platform_driver abx500_chargalg_driver = { .probe = abx500_chargalg_probe, - .remove = __devexit_p(abx500_chargalg_remove), + .remove = abx500_chargalg_remove, .suspend = abx500_chargalg_suspend, .resume = abx500_chargalg_resume, .driver = { pgpaeXrzVN5TU.pgp Description: PGP signature
linux-next: manual merge of the driver-core tree with the battery tree
Hi Greg, Today's linux-next merge of the driver-core tree got a conflict in drivers/power/ab8500_fg.c between commit e0f1abeba5c2 ("ab8500: Add devicetree support for fuelgauge") from the battery tree and commit c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. I fixed it up (see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwells...@canb.auug.org.au diff --cc drivers/power/ab8500_fg.c index ed62ef7,331dc43..000 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@@ -2440,39 -2442,21 +2440,39 @@@ static struct ab8500_fg_interrupts ab85 {"CCEOC", ab8500_fg_cc_data_end_handler}, }; +static char *supply_interface[] = { + "ab8500_chargalg", + "ab8500_usb", +}; + - static int __devinit ab8500_fg_probe(struct platform_device *pdev) + static int ab8500_fg_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; + struct ab8500_fg *di; int i, irq; int ret = 0; - struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data; - struct ab8500_fg *di; - - if (!plat_data) { - dev_err(&pdev->dev, "No platform data\n"); - return -EINVAL; - } - di = kzalloc(sizeof(*di), GFP_KERNEL); - if (!di) + di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL); + if (!di) { + dev_err(&pdev->dev, "%s no mem for ab8500_fg\n", __func__); return -ENOMEM; + } + di->bat = pdev->mfd_cell->platform_data; + if (!di->bat) { + if (np) { + ret = bmdevs_of_probe(&pdev->dev, np, &di->bat); + if (ret) { + dev_err(&pdev->dev, + "failed to get battery information\n"); + return ret; + } + } else { + dev_err(&pdev->dev, "missing dt node for ab8500_fg\n"); + return -EINVAL; + } + } else { + dev_info(&pdev->dev, "falling back to legacy platform data\n"); + } mutex_init(&di->cc_lock); @@@ -2608,14 -2609,12 +2608,14 @@@ free_inst_curr_wq return ret; } +static const struct of_device_id ab8500_fg_match[] = { + { .compatible = "stericsson,ab8500-fg", }, + { }, +}; + static struct platform_driver ab8500_fg_driver = { .probe = ab8500_fg_probe, - .remove = __devexit_p(ab8500_fg_remove), + .remove = ab8500_fg_remove, .suspend = ab8500_fg_suspend, .resume = ab8500_fg_resume, .driver = { pgpIWSJoZioAj.pgp Description: PGP signature
linux-next: manual merge of the driver-core tree with the battery tree
Hi Greg, Today's linux-next merge of the driver-core tree got a conflict in drivers/power/ab8500_charger.c between commit 4aef72dbb2e8 ("ab8500: Add devicetree support for charger") from the battery tree and commit c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. I fixed it up (see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwells...@canb.auug.org.au diff --cc drivers/power/ab8500_charger.c index dddc947,7ecb8ab..000 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@@ -2532,41 -2531,20 +2532,41 @@@ static int ab8500_charger_remove(struc return 0; } +static char *supply_interface[] = { + "ab8500_chargalg", + "ab8500_fg", + "ab8500_btemp", +}; + - static int __devinit ab8500_charger_probe(struct platform_device *pdev) + static int ab8500_charger_probe(struct platform_device *pdev) { - int irq, i, charger_status, ret = 0; - struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data; + struct device_node *np = pdev->dev.of_node; struct ab8500_charger *di; + int irq, i, charger_status, ret = 0; - if (!plat_data) { - dev_err(&pdev->dev, "No platform data\n"); - return -EINVAL; - } - - di = kzalloc(sizeof(*di), GFP_KERNEL); - if (!di) + di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL); + if (!di) { + dev_err(&pdev->dev, "%s no mem for ab8500_charger\n", __func__); return -ENOMEM; + } + di->bat = pdev->mfd_cell->platform_data; + if (!di->bat) { + if (np) { + ret = bmdevs_of_probe(&pdev->dev, np, &di->bat); + if (ret) { + dev_err(&pdev->dev, + "failed to get battery information\n"); + return ret; + } + di->autopower_cfg = of_property_read_bool(np, "autopower_cfg"); + } else { + dev_err(&pdev->dev, "missing dt node for ab8500_charger\n"); + return -EINVAL; + } + } else { + dev_info(&pdev->dev, "falling back to legacy platform data\n"); + di->autopower_cfg = false; + } /* get parent data */ di->dev = &pdev->dev; @@@ -2765,14 -2760,12 +2765,14 @@@ free_charger_wq return ret; } +static const struct of_device_id ab8500_charger_match[] = { + { .compatible = "stericsson,ab8500-charger", }, + { }, +}; + static struct platform_driver ab8500_charger_driver = { .probe = ab8500_charger_probe, - .remove = __devexit_p(ab8500_charger_remove), + .remove = ab8500_charger_remove, .suspend = ab8500_charger_suspend, .resume = ab8500_charger_resume, .driver = { pgpRNANioOpPd.pgp Description: PGP signature
linux-next: manual merge of the driver-core tree with the battery tree
Hi Greg, Today's linux-next merge of the driver-core tree got a conflict in drivers/power/ab8500_btemp.c between commit bd9e8ab2d58d ("ab8500: Add devicetree support for btemp") from the battery tree and commit c8afa6406e60 ("power: remove use of __devinit") from the driver-core tree. I fixed it up (see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwells...@canb.auug.org.au diff --cc drivers/power/ab8500_btemp.c index 8135542,989b099..000 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@@ -959,39 -960,21 +959,39 @@@ static int ab8500_btemp_remove(struct p return 0; } +static char *supply_interface[] = { + "ab8500_chargalg", + "ab8500_fg", +}; + - static int __devinit ab8500_btemp_probe(struct platform_device *pdev) + static int ab8500_btemp_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; + struct ab8500_btemp *di; int irq, i, ret = 0; u8 val; - struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data; - struct ab8500_btemp *di; - - if (!plat_data) { - dev_err(&pdev->dev, "No platform data\n"); - return -EINVAL; - } - di = kzalloc(sizeof(*di), GFP_KERNEL); - if (!di) + di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL); + if (!di) { + dev_err(&pdev->dev, "%s no mem for ab8500_btemp\n", __func__); return -ENOMEM; + } + di->bat = pdev->mfd_cell->platform_data; + if (!di->bat) { + if (np) { + ret = bmdevs_of_probe(&pdev->dev, np, &di->bat); + if (ret) { + dev_err(&pdev->dev, + "failed to get battery information\n"); + return ret; + } + } else { + dev_err(&pdev->dev, "missing dt node for ab8500_btemp\n"); + return -EINVAL; + } + } else { + dev_info(&pdev->dev, "falling back to legacy platform data\n"); + } /* get parent data */ di->dev = &pdev->dev; @@@ -1096,14 -1096,12 +1096,14 @@@ free_btemp_wq return ret; } +static const struct of_device_id ab8500_btemp_match[] = { + { .compatible = "stericsson,ab8500-btemp", }, + { }, +}; + static struct platform_driver ab8500_btemp_driver = { .probe = ab8500_btemp_probe, - .remove = __devexit_p(ab8500_btemp_remove), + .remove = ab8500_btemp_remove, .suspend = ab8500_btemp_suspend, .resume = ab8500_btemp_resume, .driver = { pgpDN2WTZ2rzJ.pgp Description: PGP signature