diff mbox series

[3/5] watchdog: ziirave_wdt: Be more verbose during firmware update

Message ID 20190731174252.18041-4-andrew.smirnov@gmail.com (mailing list archive)
State Accepted
Headers show
Series Ziirave_wdt driver fixes | expand

Commit Message

Andrey Smirnov July 31, 2019, 5:42 p.m. UTC
Add more error logging to ziirave_firm_upload() for diagnostics.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rick Ramstetter <rick@anteaterllc.com>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/watchdog/ziirave_wdt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Guenter Roeck July 31, 2019, 9:43 p.m. UTC | #1
On Wed, Jul 31, 2019 at 10:42:50AM -0700, Andrey Smirnov wrote:
> Add more error logging to ziirave_firm_upload() for diagnostics.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Rick Ramstetter <rick@anteaterllc.com>
> Cc: linux-watchdog@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/ziirave_wdt.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c
> index 8c71341a9c1c..89ce6982ba53 100644
> --- a/drivers/watchdog/ziirave_wdt.c
> +++ b/drivers/watchdog/ziirave_wdt.c
> @@ -335,14 +335,18 @@ static int ziirave_firm_upload(struct watchdog_device *wdd,
>  
>  	ret = ziirave_firm_write_byte(wdd, ZIIRAVE_CMD_JUMP_TO_BOOTLOADER, 1,
>  				      false);
> -	if (ret)
> +	if (ret) {
> +		dev_err(&client->dev, "Failed to jump to bootloader\n");
>  		return ret;
> +	}
>  
>  	msleep(500);
>  
>  	ret = ziirave_firm_write_byte(wdd, ZIIRAVE_CMD_DOWNLOAD_START, 1, true);
> -	if (ret)
> +	if (ret) {
> +		dev_err(&client->dev, "Failed to start download\n");
>  		return ret;
> +	}
>  
>  	msleep(500);
>  
> -- 
> 2.21.0
>
diff mbox series

Patch

diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c
index 8c71341a9c1c..89ce6982ba53 100644
--- a/drivers/watchdog/ziirave_wdt.c
+++ b/drivers/watchdog/ziirave_wdt.c
@@ -335,14 +335,18 @@  static int ziirave_firm_upload(struct watchdog_device *wdd,
 
 	ret = ziirave_firm_write_byte(wdd, ZIIRAVE_CMD_JUMP_TO_BOOTLOADER, 1,
 				      false);
-	if (ret)
+	if (ret) {
+		dev_err(&client->dev, "Failed to jump to bootloader\n");
 		return ret;
+	}
 
 	msleep(500);
 
 	ret = ziirave_firm_write_byte(wdd, ZIIRAVE_CMD_DOWNLOAD_START, 1, true);
-	if (ret)
+	if (ret) {
+		dev_err(&client->dev, "Failed to start download\n");
 		return ret;
+	}
 
 	msleep(500);