Re: [PATCH] power/ds2760_battery: Add rated capacity of the hx4700 3600mAh battery

From: Paul Parsons
Date: Thu Nov 24 2011 - 18:53:01 EST


--- On Thu, 24/11/11, Philipp Zabel <philipp.zabel@xxxxxxxxx> wrote:
> > +#ifdef CONFIG_MACH_H4700
> > +       0,
> > +       3600,   /* HP iPAQ hx4700 3.7V 3600mAh
> (359114-001) */
> > +#endif
>
> Is that #ifdef needed? I know there's another one a few
> lines up, but
> I think that one is already unfortunate and there is no
> conflict here.

Yes it is needed, because the rated_capacities[] table must contain different values for different platforms. The #ifdefs preserve the original table for other platforms.

Agreed it's untidy. Ideally the table would be replaced by platform specific data. However it's not obvious which other platforms use the table, nor whether the original table is correct for those other platforms. I presume that the table was originally believed to be common for all ds2760 based platforms, but the hx4700 demonstrates this is not the case.
--
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/