From: Alexandre Bailon Date: Fri, 11 Mar 2016 16:23:37 +0000 (+0100) Subject: greybus: loopback: Fix broken loopback min values X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1dc8d3d7c568d9a80fa20570a764da57677f1050;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: loopback: Fix broken loopback min values Currently, when a loopback test completely fail, loopback will return 4294967295 for every min value. Return 0 instead of 4294967295 in such case. Signed-off-by: Alexandre Bailon Reviewed-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 6c62706bb94c..9b732a866455 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -148,6 +148,9 @@ static ssize_t name##_##field##_show(struct device *dev, \ char *buf) \ { \ struct gb_loopback *gb = dev_get_drvdata(dev); \ + /* Report 0 for min and max if no transfer successed */ \ + if (!gb->requests_completed) \ + return sprintf(buf, "0\n"); \ return sprintf(buf, "%"#type"\n", gb->name.field); \ } \ static DEVICE_ATTR_RO(name##_##field)