Repository navigation
Commit 501e187
spi: fix the divide by 0 error when calculating xfer waiting time
[ Upstream commit 6170d07 ]
The xfer waiting time is the result of xfer->len / xfer->speed_hz. This
patch makes the assumption of 100khz xfer speed if the xfer->speed_hz is
not assigned and stays 0. This avoids the divide by 0 issue and ensures
a reasonable tolerant waiting time.
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/1609723749-3557-1-git-send-email-yilun.xu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 17a0868 commit 501e187
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
| 1103 | + | |
1103 | 1104 | | |
1104 | 1105 | | |
1105 | 1106 | | |
| |||
1108 | 1109 | | |
1109 | 1110 | | |
1110 | 1111 | | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1111 | 1115 | | |
1112 | | - | |
| 1116 | + | |
1113 | 1117 | | |
1114 | 1118 | | |
1115 | 1119 | | |
| |||
0 commit comments