Re: [PATCH] Intel MID platform battery driver. (right patch thistime)

From: Anton Vorontsov
Date: Thu Jun 17 2010 - 14:28:54 EST


On Thu, Jun 17, 2010 at 06:12:36PM +0100, Alan Cox wrote:
> Oops sorry - try the right version this time.
>
> From: Nithish Mahalingam <nithish.mahalingam@xxxxxxxxx>
>
> The PMIC Battery driver provides battery charging and battery gauge
> functionality on Intel MID platforms. This provides the basic functions. There
> are some USB drivers to merge before the selection of charging between the
> different USB power levels can be enabled.
>
> Moved to a platform device by Alek Du.
>
> Signed-off-by: Nithish Mahalingam <nithish.mahalingam@xxxxxxxxx>
> Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>

Applied to battery-2.6.git, thanks.

However, note that there's another issue that should be fixed
both in this driver and in the platform (or SPI device driver)
code.

[...]
> +static __devinit int probe(int irq, struct device *dev)

Notice 'int irq' here.

[...]
> +static int __devinit platform_pmic_battery_probe(struct platform_device *pdev)
> +{
> + return probe(pdev->id, &pdev->dev);

So the irq number is derived from the platform device ID.
Which is very bizarre, and not how things supposed to work.
I guess there should be an IRQ resource for the device
instead.

--
Anton Vorontsov
email: cbouatmailru@xxxxxxxxx
irc://irc.freenode.net/bd2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/