power: supply: charger-manager: Verify polling interval only when polling requested
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> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
parent
39b4fb8056
commit
111242d6e1
|
@ -1700,8 +1700,9 @@ static int charger_manager_probe(struct platform_device *pdev)
|
||||||
power_supply_put(psy);
|
power_supply_put(psy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desc->polling_interval_ms == 0 ||
|
if (cm->desc->polling_mode != CM_POLL_DISABLE &&
|
||||||
msecs_to_jiffies(desc->polling_interval_ms) <= CM_JIFFIES_SMALL) {
|
(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");
|
dev_err(&pdev->dev, "polling_interval_ms is too small\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue