[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150125105857.GA16570@earth.universe>
Date: Sun, 25 Jan 2015 11:58:58 +0100
From: Sebastian Reichel <sre@...nel.org>
To: Todd Brandt <todd.e.brandt@...ux.intel.com>
Cc: linux-pm@...r.kernel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, todd.e.brandt@...el.com,
jacob.jun.pan@...ux.intel.com, sameo@...ux.intel.com,
lee.jones@...aro.org, dbaryshkov@...il.com, dwmw2@...radead.org,
david.woodhouse@...el.com
Subject: Re: [PATCH v2 3/3] X-Power AXP288 PMIC Fuel Gauge Driver
Hi,
On Thu, Jan 22, 2015 at 12:52:07PM -0800, Todd Brandt wrote:
> New power_supply driver at driver/power which interfaces with the
> axp20x mfd driver as a cell. Provides battery info, monitors for
> changes, and generates alerts on temperature and capacity issues
Apart from two issues the driver looks fine to me.
> [...]
>
> +static void fuel_gauge_init_irq(struct axp288_fg_info *info)
> +{
> + int ret, i, pirq;
> +
> + for (i = 0; i < AXP288_FG_INTR_NUM; i++) {
> + pirq = platform_get_irq(info->pdev, i);
> + info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq);
> + if (info->irq[i] < 0) {
> + dev_warn(&info->pdev->dev,
> + "regmap_irq get virq failed for IRQ %d: %d\n",
> + pirq, info->irq[i]);
> + info->irq[i] = -1;
> + goto intr_failed;
> + }
> + ret = request_threaded_irq(info->irq[i],
> + NULL, fuel_gauge_thread_handler,
> + IRQF_ONESHOT, DEV_NAME, info);
> + if (ret) {
> + dev_warn(&info->pdev->dev,
> + "request irq failed for IRQ %d: %d\n",
> + pirq, info->irq[i]);
> + info->irq[i] = -1;
> + goto intr_failed;
> + } else {
> + dev_info(&info->pdev->dev, "HW IRQ %d -> VIRQ %d\n",
> + pirq, info->irq[i]);
> + }
> + }
> + return;
> +
> +intr_failed:
> + for (; i > 0; i--) {
> + free_irq(info->irq[i - 1], info);
> + info->irq[i - 1] = -1;
> + }
This is missing in axp288_fuel_gauge_remove().
> +}
>
> [...]
>
> +static int axp288_fuel_gauge_remove(struct platform_device *pdev)
> +{
> + struct axp288_fg_info *info = platform_get_drvdata(pdev);
> +
> + cancel_delayed_work_sync(&info->status_monitor);
> + power_supply_unregister(&info->bat);
> + fuel_gauge_remove_debugfs(info);
> +
> + return 0;
> +}
>
> [...]
>
> +static struct platform_driver axp288_fuel_gauge_driver = {
> + .probe = axp288_fuel_gauge_probe,
> + .remove = axp288_fuel_gauge_remove,
> + .id_table = axp288_fg_id_table,
> + .driver = {
> + .name = DEV_NAME,
> + .owner = THIS_MODULE,
please remove .owner, it will be set automatically by
module_platform_driver.
> [...]
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists