Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755253AbcC1RP4 (ORCPT ); Mon, 28 Mar 2016 13:15:56 -0400 Received: from mga11.intel.com ([192.55.52.93]:53991 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754046AbcC1RPy (ORCPT ); Mon, 28 Mar 2016 13:15:54 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,407,1455004800"; d="scan'208";a="74633803" From: Irina Tirdea To: Jonathan Cameron , linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Markus Pargmann , Irina Tirdea Subject: [PATCH 1/1] iio: gyro: bmg160: fix buffer read values Date: Mon, 28 Mar 2016 20:15:46 +0300 Message-Id: <1459185346-18600-1-git-send-email-irina.tirdea@intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 897 Lines: 28 When reading gyroscope axes using iio buffers, the values returned are always 0. In the interrupt handler, the return value of the read operation is returned to the user instead of the value read. Return the value read to the user. This is also fixed in commit 82d8e5da1a33 ("iio: accel: bmg160: optimize transfers in trigger handler"). Signed-off-by: Irina Tirdea --- drivers/iio/gyro/bmg160_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 295cf1d..e165ce9 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -781,7 +781,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p) mutex_unlock(&data->mutex); goto err; } - data->buffer[i++] = ret; + data->buffer[i++] = val; } mutex_unlock(&data->mutex); -- 1.9.1