Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3a66c5e authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: host: xhci-plat: Fix IMOD configuration from sysfs



Currently config_imod_store function checks for the return value
of kstrtouint and bails out if it is not 1. But the success case
return value of kstrtouint is 0 instead, with -ERANGE and -EINVAL
being error case values. This leads to the IMOD setting failure.
Fix this by fixing the return value check of kstrtouint.

Change-Id: I723f4efbe9c39fc91d5f57ef657daaab61fba212
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 15c00787
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ static ssize_t config_imod_store(struct device *pdev,
	u32 imod;
	unsigned long flags;

	if (kstrtouint(buff, 10, &imod) != 1)
	if (kstrtouint(buff, 10, &imod) < 0)
		return 0;

	imod &= ER_IRQ_INTERVAL_MASK;