Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933116AbbGSTSr (ORCPT ); Sun, 19 Jul 2015 15:18:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38878 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932684AbbGSTSl (ORCPT ); Sun, 19 Jul 2015 15:18:41 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arun Chandran , Mark Brown Subject: [PATCH 4.0 35/58] regmap: Fix regmap_bulk_read in BE mode Date: Sun, 19 Jul 2015 12:11:13 -0700 Message-Id: <20150719190812.454111824@linuxfoundation.org> X-Mailer: git-send-email 2.4.6 In-Reply-To: <20150719190811.308546345@linuxfoundation.org> References: <20150719190811.308546345@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1258 Lines: 41 4.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arun Chandran commit 15b8d2c41fe5839582029f65c5f7004db451cc2b upstream. In big endian mode regmap_bulk_read gives incorrect data for byte reads. This is because memcpy of a single byte from an address after full word read gives different results when endianness differs. ie. we get little-end in LE and big-end in BE. Signed-off-by: Arun Chandran Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/base/regmap/regmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -2318,7 +2318,7 @@ int regmap_bulk_read(struct regmap *map, &ival); if (ret != 0) return ret; - memcpy(val + (i * val_bytes), &ival, val_bytes); + map->format.format_val(val + (i * val_bytes), ival, 0); } } -- 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/