Commit 8a00785e authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Marc Kleine-Budde

can: janz-ican3: fix type mismatch in assignment

return type of wait_for_completion_timeout is unsigned long not int, this patch
removes the type mismatch by moving the call into the condition.
Signed-off-by: default avatarNicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 7e8acbb6
...@@ -1679,8 +1679,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev, ...@@ -1679,8 +1679,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev,
if (ret) if (ret)
return ret; return ret;
ret = wait_for_completion_timeout(&mod->buserror_comp, HZ); if (!wait_for_completion_timeout(&mod->buserror_comp, HZ)) {
if (ret == 0) {
netdev_info(mod->ndev, "%s timed out\n", __func__); netdev_info(mod->ndev, "%s timed out\n", __func__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -1705,8 +1704,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev, ...@@ -1705,8 +1704,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev,
if (ret) if (ret)
return ret; return ret;
ret = wait_for_completion_timeout(&mod->termination_comp, HZ); if (!wait_for_completion_timeout(&mod->termination_comp, HZ)) {
if (ret == 0) {
netdev_info(mod->ndev, "%s timed out\n", __func__); netdev_info(mod->ndev, "%s timed out\n", __func__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment