Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964851AbbHLI61 (ORCPT ); Wed, 12 Aug 2015 04:58:27 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60872 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934492AbbHLI6S (ORCPT ); Wed, 12 Aug 2015 04:58:18 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Haibo Chen , Fugang Duan , Jonathan Cameron , Luis Henriques Subject: [PATCH 3.16.y-ckt 083/118] iio: adc: vf610: fix the adc register read fail issue Date: Wed, 12 Aug 2015 09:56:25 +0100 Message-Id: <1439369820-27005-84-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439369820-27005-1-git-send-email-luis.henriques@canonical.com> References: <1439369820-27005-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1352 Lines: 37 3.16.7-ckt16 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Fugang Duan commit bf604a4c44a91cc2ceb60d4643a091b6b32cc999 upstream. Read the register only when the adc register address is 4 byte aligned. (rather than the other way around). Signed-off-by: Haibo Chen Signed-off-by: Fugang Duan Signed-off-by: Jonathan Cameron Signed-off-by: Luis Henriques --- drivers/iio/adc/vf610_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index 11048473b89e..0062d0e71d03 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c @@ -555,7 +555,7 @@ static int vf610_adc_reg_access(struct iio_dev *indio_dev, struct vf610_adc *info = iio_priv(indio_dev); if ((readval == NULL) || - (!(reg % 4) || (reg > VF610_REG_ADC_PCTL))) + ((reg % 4) || (reg > VF610_REG_ADC_PCTL))) return -EINVAL; *readval = readl(info->regs + reg); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/