Module Name:    src
Committed By:   jakllsch
Date:           Fri Aug 19 03:23:39 UTC 2016

Modified Files:
        src/sys/dev/spi: spiflash.c

Log Message:
Reset b_resid when tossing transfer with non-zero b_error.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/spi/spiflash.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/spi/spiflash.c
diff -u src/sys/dev/spi/spiflash.c:1.18 src/sys/dev/spi/spiflash.c:1.19
--- src/sys/dev/spi/spiflash.c:1.18	Wed Jul 22 10:07:59 2015
+++ src/sys/dev/spi/spiflash.c	Fri Aug 19 03:23:39 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: spiflash.c,v 1.18 2015/07/22 10:07:59 ryo Exp $ */
+/* $NetBSD: spiflash.c,v 1.19 2016/08/19 03:23:39 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.18 2015/07/22 10:07:59 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.19 2016/08/19 03:23:39 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -313,6 +313,7 @@ spiflash_strategy(struct buf *bp)
 	sc = device_lookup_private(&spiflash_cd, DISKUNIT(bp->b_dev));
 	if (sc == NULL) {
 		bp->b_error = ENXIO;
+		bp->b_resid = bp->b_bcount;
 		biodone(bp);
 		return;
 	}
@@ -320,6 +321,7 @@ spiflash_strategy(struct buf *bp)
 	if (((bp->b_bcount % sc->sc_write_size) != 0) ||
 	    (bp->b_blkno < 0)) {
 		bp->b_error = EINVAL;
+		bp->b_resid = bp->b_bcount;
 		biodone(bp);
 		return;
 	}

Reply via email to