lkml.org 
[lkml]   [2008]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-01-04 02:33    [W:0.065 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site