This patch adds error checking to the nvec_power_poll function, which allows for easier debugging if the driver has issues. Signed-off-by: Thomas Avery <tavery321@xxxxxxxxx> --- drivers/staging/nvec/nvec_power.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c index 0e861c4bfcbf..c82679ae0563 100644 --- a/drivers/staging/nvec/nvec_power.c +++ b/drivers/staging/nvec/nvec_power.c @@ -347,6 +347,7 @@ static int const bat_iter[] = { static void nvec_power_poll(struct work_struct *work) { + int err; char buf[] = { NVEC_SYS, GET_SYSTEM_STATUS }; struct nvec_power *power = container_of(work, struct nvec_power, poller.work); @@ -355,7 +356,10 @@ static void nvec_power_poll(struct work_struct *work) counter = 0; /* AC status via sys req */ - nvec_write_async(power->nvec, buf, 2); + err = nvec_write_async(power->nvec, buf, 2); + if (err != 0) + return err; + msleep(100); /* -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html