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: 5188781 Return-Path: X-Original-To: patchwork-linux-arm@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 6BDB29F30B for ; Wed, 29 Oct 2014 15:14:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A8E620121 for ; Wed, 29 Oct 2014 15:14:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0437200ED for ; Wed, 29 Oct 2014 15:14:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjUuQ-0000UV-Tv; Wed, 29 Oct 2014 15:11:38 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjUuF-0008Vq-PI for linux-arm-kernel@lists.infradead.org; Wed, 29 Oct 2014 15:11:33 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141029_081127_996185_AE9408C2 X-CRM114-Status: GOOD ( 11.78 ) X-Spam-Score: -5.6 (-----) Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Chanwoo Choi , Kyungmin Park , Javier Martinez Canillas , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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)) {