LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Todd Brandt <todd.e.brandt@linux.intel.com>
Cc: linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, todd.e.brandt@intel.com,
	jacob.jun.pan@linux.intel.com, sameo@linux.intel.com,
	lee.jones@linaro.org, dbaryshkov@gmail.com, dwmw2@infradead.org,
	david.woodhouse@intel.com
Subject: Re: [PATCH v2 3/3] X-Power AXP288 PMIC Fuel Gauge Driver
Date: Sun, 25 Jan 2015 11:58:58 +0100	[thread overview]
Message-ID: <20150125105857.GA16570@earth.universe> (raw)
In-Reply-To: <bdb977f4734a257f88b44f65c2554f30a247891e.1421957474.git.todd.e.brandt@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2040 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-01-25 10:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 20:52 [PATCH v2 0/3] " Todd Brandt
2015-01-22 20:52 ` [PATCH v2 1/3] mfd/axp20x: change battery cell name to fuel gauge Todd Brandt
2015-01-25 12:57   ` Sebastian Reichel
2015-01-22 20:52 ` [PATCH v2 2/3] mfd/axp20x: add support for fuel gauge cell Todd Brandt
2015-01-25 12:59   ` Sebastian Reichel
2015-01-22 20:52 ` [PATCH v2 3/3] X-Power AXP288 PMIC Fuel Gauge Driver Todd Brandt
2015-01-25 10:58   ` Sebastian Reichel [this message]
2015-01-25 22:34   ` Jonathan Cameron
2015-01-27  0:31   ` Jacob Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150125105857.GA16570@earth.universe \
    --to=sre@kernel.org \
    --cc=david.woodhouse@intel.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=todd.e.brandt@intel.com \
    --cc=todd.e.brandt@linux.intel.com \
    --subject='Re: [PATCH v2 3/3] X-Power AXP288 PMIC Fuel Gauge Driver' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).