From: H Hartley Sweeten Date: Tue, 10 Dec 2013 23:31:25 +0000 (-0700) Subject: staging: comedi: drivers: fix return value of comedi_load_firmware() X-Git-Tag: v3.13-rc5~26^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6236c0ce39c809c336ca929f68cf8ad02cf94e0;p=platform%2Fkernel%2Flinux-exynos.git staging: comedi: drivers: fix return value of comedi_load_firmware() Some of the callback functions that upload the firmware in the comedi drivers return a positive value indicating the number of bytes sent to the device. Detect this condition and just return '0' to indicate a successful upload. Reported-by: Bernd Porr Signed-off-by: H Hartley Sweeten Acked-by: Ian Abbott Acked-by: Dan Carpenter Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 8f02bf6..4964d2a 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -446,7 +446,7 @@ int comedi_load_firmware(struct comedi_device *dev, release_firmware(fw); } - return ret; + return ret < 0 ? ret : 0; } EXPORT_SYMBOL_GPL(comedi_load_firmware);