Message ID | 20180321155000.GA7528@lenoch (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Hi, On Wed, Mar 21, 2018 at 04:50:00PM +0100, Ladislav Michl wrote: > Driver bails out with -EINVAL when no polling specififaion is requested. > Fix that by verifing polling interval only if polling_mode is different > from CM_POLL_DISABLE. > > Signed-off-by: Ladislav Michl <ladis@linux-mips.org> > --- Thanks, queued. -- Sebastian > drivers/power/supply/charger-manager.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c > index 1de4b4493824..2a50b4654793 100644 > --- a/drivers/power/supply/charger-manager.c > +++ b/drivers/power/supply/charger-manager.c > @@ -1700,8 +1700,9 @@ static int charger_manager_probe(struct platform_device *pdev) > power_supply_put(psy); > } > > - if (desc->polling_interval_ms == 0 || > - msecs_to_jiffies(desc->polling_interval_ms) <= CM_JIFFIES_SMALL) { > + if (cm->desc->polling_mode != CM_POLL_DISABLE && > + (desc->polling_interval_ms == 0 || > + msecs_to_jiffies(desc->polling_interval_ms) <= CM_JIFFIES_SMALL)) { > dev_err(&pdev->dev, "polling_interval_ms is too small\n"); > return -EINVAL; > } > -- > 2.16.2 >
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index 1de4b4493824..2a50b4654793 100644 --- a/drivers/power/supply/charger-manager.c +++ b/drivers/power/supply/charger-manager.c @@ -1700,8 +1700,9 @@ static int charger_manager_probe(struct platform_device *pdev) power_supply_put(psy); } - if (desc->polling_interval_ms == 0 || - msecs_to_jiffies(desc->polling_interval_ms) <= CM_JIFFIES_SMALL) { + if (cm->desc->polling_mode != CM_POLL_DISABLE && + (desc->polling_interval_ms == 0 || + msecs_to_jiffies(desc->polling_interval_ms) <= CM_JIFFIES_SMALL)) { dev_err(&pdev->dev, "polling_interval_ms is too small\n"); return -EINVAL; }
Driver bails out with -EINVAL when no polling specififaion is requested. Fix that by verifing polling interval only if polling_mode is different from CM_POLL_DISABLE. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> --- drivers/power/supply/charger-manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)