Messages in this thread | | | Date | Fri, 4 Jan 2008 04:31:10 +0300 | From | Dmitry <> | Subject | Re: [PATCH] pda-power: only register available psu |
| |
Hi, Anton,
2008/1/4, Anton Vorontsov <cbouatmailru@gmail.com>: > Hi Dmitry, > > On Thu, Jan 03, 2008 at 03:53:19AM +0300, Dmitry Baryshkov wrote: > > Currently pda-power adds both ac and usb power supply units. > > This patch fixes it so that psu are added only if they are enabled. > > Thanks for the patch, this should be fixed of course. A comment > though... > > > Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> > > > > diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c > > index c058f28..42eac09 100644 > > --- a/drivers/power/pda_power.c > > +++ b/drivers/power/pda_power.c > [...] > > if (ac_irq) { > > + ret = power_supply_register(&pdev->dev, &pda_power_supplies[0]); > > I don't think we should check for IRQs when determining which one > of power supplies to register. Better use is_{ac,usb}_online > callbacks, this will not produce an obstacle to implement polling -- > when irqs aren't mandatory. I'll send my two pending patches to show > the idea. > > For this particular issue, I think something like that should work. > If it works for you, I'll commit that version, preserving your > authorship, of course.
Yes, it works. Thank you very much!
-- With best wishes Dmitry
| |