From patchwork Wed Oct 29 15:06:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5188601 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D28F19F30B for ; Wed, 29 Oct 2014 15:11:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F403320268 for ; Wed, 29 Oct 2014 15:11:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AC8820303 for ; Wed, 29 Oct 2014 15:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933727AbaJ2PLG (ORCPT ); Wed, 29 Oct 2014 11:11:06 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47969 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933465AbaJ2PLD (ORCPT ); Wed, 29 Oct 2014 11:11:03 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NE70003BOZ11T30@mailout2.w1.samsung.com>; Wed, 29 Oct 2014 15:13:49 +0000 (GMT) X-AuditID: cbfec7f4-b7f6c6d00000120b-8e-54510384970b Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 1A.47.04619.48301545; Wed, 29 Oct 2014 15:11:00 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NE70053ROU6N540@eusync1.samsung.com>; Wed, 29 Oct 2014 15:11:00 +0000 (GMT) From: Krzysztof Kozlowski To: Samuel Ortiz , Lee Jones , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Ben Dooks , Kukjin Kim , Russell King , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org Cc: Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Javier Martinez Canillas , Chanwoo Choi , Krzysztof Kozlowski Subject: [PATCH v2 1/8] regulator: max77686: Consistently index opmode array by rdev id Date: Wed, 29 Oct 2014 16:06:39 +0100 Message-id: <1414595206-1437-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1414595206-1437-1-git-send-email-k.kozlowski@samsung.com> References: <1414595206-1437-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsVy+t/xy7otzIEhBnf+KFtsnLGe1WLSugNM FlMfPmGzuP7lOavF/CPnWC2O/i6weP3C0KJ3wVU2i7NNb9gt7n89ymjx7UoHk8Wmx9dYLS7v msNmMeP8PiaL25d5LdYeuctucbqb1UHQo6W5h83j7/PrLB5/V71g9tg56y67x6ZVnWwed67t YfOYdzLQY/OSeo++LasYPT5vkgvgiuKySUnNySxLLdK3S+DKuLl8N2vBda6Khwf2sDcwPuHo YuTkkBAwkVjwagsjhC0mceHeerYuRi4OIYGljBIvz7WzQjh9TBIdc5axglSxCRhLbF6+BKxK RKCTWaLnYC8ziMMssJpJ4ueVU8wgVcICkRLH159gAbFZBFQl1s4/xgRi8wq4SRxddoQJYp+c xMljk8Gmcgq4Syxs+QB2hxBQzdtlk1gmMPIuYGRYxSiaWppcUJyUnmuoV5yYW1yal66XnJ+7 iRES5F92MC4+ZnWIUYCDUYmH12FjQIgQa2JZcWXuIUYJDmYlEd7Pv4BCvCmJlVWpRfnxRaU5 qcWHGJk4OKUaGJ1SEpctEvh4jGff1BndAmwf3nX+uO96RIUr7rHPrpLHmzWWskw8cj/k5I1k 4UeMM33L325/L39RgLfpN5vbmVkvPs6Zc3Ojx0odLZfze5733BK6yHz5dV5BvIXko4wnlx+H pq88KbnWpvTEV87vgUx+sv1Rri41X3+v/9rBei7YoY/XqX5llo8SS3FGoqEWc1FxIgDM/Tde UAIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Mixed indexes were used for array of opmodes in max77686_data structure: id of regulator and index of regulator_desc array. These indexes are exactly the same but the mixture may confuse. Use consistently the id of regulator. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/max77686.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c index 09b0d8c20a9d..27c5f4556044 100644 --- a/drivers/regulator/max77686.c +++ b/drivers/regulator/max77686.c @@ -82,6 +82,7 @@ enum max77686_ramp_rate { }; struct max77686_data { + /* Array indexed by regulator id */ unsigned int opmode[MAX77686_REGULATORS]; }; @@ -513,12 +514,13 @@ static int max77686_pmic_probe(struct platform_device *pdev) for (i = 0; i < MAX77686_REGULATORS; i++) { struct regulator_dev *rdev; + int id = regulators[i].id; config.init_data = pdata->regulators[i].initdata; config.of_node = pdata->regulators[i].of_node; - max77686->opmode[i] = regulators[i].enable_mask >> - max77686_get_opmode_shift(i); + max77686->opmode[id] = regulators[i].enable_mask >> + max77686_get_opmode_shift(id); rdev = devm_regulator_register(&pdev->dev, ®ulators[i], &config); if (IS_ERR(rdev)) {