Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1843578imd; Sun, 4 Nov 2018 10:38:13 -0800 (PST) X-Google-Smtp-Source: AJdET5feF8ajPhD+KJSg6yPQ5ISF6AyWmHG6ia3AIE6YE+hdhFbAY089rfl6/hUV1xtCCrv7cShz X-Received: by 2002:a63:4141:: with SMTP id o62-v6mr1388577pga.370.1541356693117; Sun, 04 Nov 2018 10:38:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541356693; cv=none; d=google.com; s=arc-20160816; b=cpp5K+oG63B9q0//HXfPLRj+0wIO+NI4fIi1viit99BSMMoYZwww0wrqRggiMbf+dC PN9tXaRMW5qgJ3+5tZsAamcOuVAhKSk22VSYl3dkg7ycu+fpcW/RnBDesYpJki0XqvJl rwlA3JbMXCHXLC7qOAJIn+REJ3v0EtXtSJsIgekcx6981o96teWwsRAmAJW2NuWTxzd3 fQBBHuejdXHKCjJzFqSHYYy0SYspSylXwEkgUWM//3DrPcfYYXSuQwWvA/2nV1rUiwih oihIQxxoE31V3wnApS+OjwAuAF9S+IhKJ7aq0IoGG7uQLKbz9ugtk6fG2LCwkTmkvgZr VOLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=doCm2OS/2EJvlRuMTJ8Jx7JYhVxM02uzdq8tLyTZsKE=; b=Bhtuk53p23UwQykeyuKIq35EXZTfu1e/jJNSezjjvpAQxL21X8Fo2KMYI6wGTP3e2B FS9qM8UUU4wi7p1pWPfZfnPWg6pgin2r7nOdKXXNvxPvLqArf9cuFWxgOu3j/BvzHegK rtkrcaGW0SD+G8rzLhnW7ZbZiQ4cPxfwscMhFIi2bIbrffgEOmlpWkmok+74k0KI/K5d rFNsrurHA2W4CYY/A4mnHg8q53Hx1T0s9ZKG6T7YUcNMWc2i8btr/TD5t13mxhLPED71 4vQQDD5vEoh2vz/XdgrKAg8okmMl3viTFVTPC7XbpBeGgRbLbdHCTnO3oAkeHMDQ7w9F WohQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GNNQb2sh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4-v6si38385510plo.69.2018.11.04.10.37.58; Sun, 04 Nov 2018 10:38:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GNNQb2sh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731963AbeKEBvy (ORCPT + 99 others); Sun, 4 Nov 2018 20:51:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:34476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730753AbeKEBvy (ORCPT ); Sun, 4 Nov 2018 20:51:54 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D50A20685; Sun, 4 Nov 2018 16:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541349382; bh=HA11KbklDGjRG7ZRlUKHlCo1NR36W7Bnsry/yU2eYZ4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GNNQb2shBcHRozohM0LU+SWc2H4V8ahrweG/ucHXtOGQqvNuvPWIer5JtWZC5nGZq jZ3qkufiQJRu7Vp5GsN5YAZpMr82fn3L21/J5aj3wpnS+RuDHtgsoesbyx7qkpdomH 8gXuWKiiTH0nw8MlQ1M+sgwnRS0AkyHfTV6b+ueM= Date: Sun, 4 Nov 2018 16:36:16 +0000 From: Jonathan Cameron To: Matheus Tavares Cc: Lars-Peter Clausen , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: Re: [PATCH v3 1/6] staging:iio:ad2s90: Make read_raw return spi_read's error code Message-ID: <20181104163616.7c864dcc@archlinux> In-Reply-To: <20181103224948.31014-2-matheus.bernardino@usp.br> References: <20181103224948.31014-1-matheus.bernardino@usp.br> <20181103224948.31014-2-matheus.bernardino@usp.br> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 3 Nov 2018 19:49:43 -0300 Matheus Tavares wrote: > Previously, when spi_read returned an error code inside ad2s90_read_raw, > the code was ignored and IIO_VAL_INT was returned. This patch makes the > function return the error code returned by spi_read when it fails. > > Signed-off-by: Matheus Tavares Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/staging/iio/resolver/ad2s90.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c > index 59586947a936..ba55de29ef36 100644 > --- a/drivers/staging/iio/resolver/ad2s90.c > +++ b/drivers/staging/iio/resolver/ad2s90.c > @@ -36,11 +36,12 @@ static int ad2s90_read_raw(struct iio_dev *indio_dev, > > mutex_lock(&st->lock); > ret = spi_read(st->sdev, st->rx, 2); > - if (ret) > - goto error_ret; > + if (ret < 0) { > + mutex_unlock(&st->lock); > + return ret; > + } > *val = (((u16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4); > > -error_ret: > mutex_unlock(&st->lock); > > return IIO_VAL_INT;