From: David Brownell Subject: [patch 2.6.24-rc1-git] tle62x0 driver stops ignoring read errors Date: Sat, 27 Oct 2007 17:38:05 -0700 Message-ID: <200710271738.05977.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Ben Dooks , spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Andrew Morton Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org The tle62x0 driver was ignoring all read errors. This patch makes it pass such errors up the stack, instead of returning bogus data. Signed-off-by: David Brownell --- drivers/spi/tle62x0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- at91.orig/drivers/spi/tle62x0.c 2007-10-27 17:28:56.000000000 -0700 +++ at91/drivers/spi/tle62x0.c 2007-10-27 17:29:50.000000000 -0700 @@ -107,8 +107,11 @@ static ssize_t tle62x0_status_show(struc mutex_lock(&st->lock); ret = tle62x0_read(st); - dev_dbg(dev, "tle62x0_read() returned %d\n", ret); + if (ret < 0) { + mutex_unlock(&st->lock); + return ret; + } for (ptr = 0; ptr < (st->nr_gpio * 2)/8; ptr += 1) { fault <<= 8; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/