Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9881551imu; Wed, 5 Dec 2018 11:56:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/U+/BFhTioNYJhJnI/dkO5bEeUo0/QVeX8kzc7VMsmXW/0VMuFCJglXdapal4KRR6Lf0WTc X-Received: by 2002:a62:6143:: with SMTP id v64mr25691652pfb.142.1544039808894; Wed, 05 Dec 2018 11:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039808; cv=none; d=google.com; s=arc-20160816; b=fcx1/uexr+3h22Ul2rFu5AM/46G2LXf6YnI4Fp3JQ4PS+asnDovw9vId0bHH2sfOp5 D/ovl6chFbhBWV+YqFB+a5byH/onUuRFacTtb5H/tOil78nuElhmcWFjbjnu+76DmwUk 2mJ6d5jN7iegVQkhwnMNy6qIMjMoSU4Z0B4Zd9wvq168iQpx4qmj2nQBtVRDUo4xS+Tf jSb58TzW6ze+Sbia4YPhyqUsuBfLZ9KlzB0vQvLVwQenz5b6Mho88yIb72kZ5s/bQgTb hLEkZF6mN6DflKnjta0HGUDgHvOiHyVsuikzqX4x8FbLVfSHmx9rpzjHk6Wqu9wVBTbE Z3oQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=ioHcmEPNV2VqTNklnZabugbNKXLD6ax/88gsjRi4E24=; b=0sa+TPONrbua40Fa+Mw4zWOfH/V9oCsBKcRWPidKAi3VCOABmGYMCMQGeHsH9qo6JX yvnK9yVdZf86X5v82QLdXIboR7vMbYS0kOzWAOXoxGOC+X3WtPkoZRLtuU5RDxUNOeiM NwpoLkymQGJrtCcgL9ii4L8hTA5RfBlbO/HR99+pt17IyaYUeiluu6ibu0T+Kgtr8e4b evaFVswV/zLO6jPBRpnOpAa+XGL2yN2m6SBKzQvdG6rOZC22hbeyjB9iqrfc3wik5pKQ HOGXEaSm/lhx9DneJm/l1NL1Bxx0j7vzhwGr/4qyEfDRVtAtqKT9vSQxWj1C9jQKIn3Q MQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=owQIFvR9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si16668775pgv.431.2018.12.05.11.56.33; Wed, 05 Dec 2018 11:56:48 -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=@gmail.com header.s=20161025 header.b=owQIFvR9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728584AbeLET4C (ORCPT + 99 others); Wed, 5 Dec 2018 14:56:02 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36180 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeLET4C (ORCPT ); Wed, 5 Dec 2018 14:56:02 -0500 Received: by mail-pl1-f194.google.com with SMTP id g9so10578470plo.3; Wed, 05 Dec 2018 11:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=ioHcmEPNV2VqTNklnZabugbNKXLD6ax/88gsjRi4E24=; b=owQIFvR9oTQccXaumsvFTHkDUJd42je1mmMYpRNTl1CptK8JLjYWc/OCThjLi7OTyF ZRM5ePoouEVsWH0THbvJ9gI8x53KOzUSS7J5eC6zq2R4+l721diM/mzSMYL12xWur0eR FHVeE/bAeWRfPCTZLHkEXRH5He6eMpUgLq+SLZaXdQsjgzqor/kdyzcAUfUZN8ugH78Y G9uOV15+DopPfSEsgUE6Z0Ua+V2cfZpYLkdd+zXmSbFak2YrAnnyG6UZcDHoU1VIJYr4 hvlsPwcT/PxAMJclTTNGw97tPErVOWA4ijy5QyB2GNhfj4h/k4RQqo2y5ZWJpycNTNhA tmJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=ioHcmEPNV2VqTNklnZabugbNKXLD6ax/88gsjRi4E24=; b=umuXUNznk3gUpnlH3Ao8hChscnt5HGcYpxWsOI5PHdX8OMYR6vncoJwSgdzxj/GAGI 2Dtv22SmL20VCCQnYjVgWmb+oSBMRi9yzlrGy73IELFx0AKvU+xKUPbCldu6Ity+Q0V7 0xNltzbixrWpePhovocB6WT0+9tLVcPtir215Vgz0w8LJvgwivXXWownP/GSNhJRyvFH nt/rPJI5g/kfK1ZBoh32QFNZLtWWmQZdWedA75fbRDeuMOmETt5umiwmkg+QuI2fPBCI q1sLCJwM1j9Bjkx9xY2kHf+YqMtZ6VPzTp8GYATdbuwG/DJUXp4MFbXW/ZoQME8Kynn8 FOTw== X-Gm-Message-State: AA+aEWbB0VDcJTQmQExamGa4kIyGFZ8aU0jHRZYX9U0LbqRGV7kkMXoH UxbuEaSr3ILNfBoiwlTGe1A= X-Received: by 2002:a17:902:1102:: with SMTP id d2mr21320529pla.138.1544039761346; Wed, 05 Dec 2018 11:56:01 -0800 (PST) Received: from Shreeya-Patel ([103.212.140.149]) by smtp.googlemail.com with ESMTPSA id m85sm36499055pfj.171.2018.12.05.11.55.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 11:56:00 -0800 (PST) Message-ID: Subject: Re: [PATCH] Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0" From: Shreeya Patel To: Jeremy Fertic , jic23@kernel.org, linux-iio@vger.kernel.org Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Thu, 06 Dec 2018 01:25:55 +0530 In-Reply-To: <20181205014900.4827-1-jeremyfertic@gmail.com> References: <20181205014900.4827-1-jeremyfertic@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-12-04 at 18:49 -0700, Jeremy Fertic wrote: > This reverts commit 00426e99789357dbff7e719a092ce36a3ce49d94. > > i2c_smbus_read_byte() returns 0 when a byte with the value 0 is read > from > the device. This is a valid read so revert the check for 0. > > Signed-off-by: Jeremy Fertic > --- Hi Jeremy, As per my understanding, 0 value indicates no error but no data read. Then how can this be a valid case? Can you please make me understand that how can we consider this as a valid case even when no data has been read? Thanks > drivers/staging/iio/addac/adt7316-i2c.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/staging/iio/addac/adt7316-i2c.c > b/drivers/staging/iio/addac/adt7316-i2c.c > index ac91163656b5..2d51bd425662 100644 > --- a/drivers/staging/iio/addac/adt7316-i2c.c > +++ b/drivers/staging/iio/addac/adt7316-i2c.c > @@ -30,10 +30,6 @@ static int adt7316_i2c_read(void *client, u8 reg, > u8 *data) > } > > ret = i2c_smbus_read_byte(client); > - > - if (!ret) > - return -EIO; > - > if (ret < 0) { > dev_err(&cl->dev, "I2C read error\n"); > return ret;