From patchwork Tue Jul 8 19:09:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 4508581 Return-Path: X-Original-To: patchwork-linux-omap@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 2C9E29F1C4 for ; Tue, 8 Jul 2014 19:10:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5BC0120212 for ; Tue, 8 Jul 2014 19:10:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F3A2201C0 for ; Tue, 8 Jul 2014 19:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755934AbaGHTKD (ORCPT ); Tue, 8 Jul 2014 15:10:03 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:47628 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755910AbaGHTJr (ORCPT ); Tue, 8 Jul 2014 15:09:47 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s68J9MYC015390; Tue, 8 Jul 2014 14:09:22 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s68J9MT4026134; Tue, 8 Jul 2014 14:09:22 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Tue, 8 Jul 2014 14:09:22 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s68J9LT1025224; Tue, 8 Jul 2014 14:09:21 -0500 From: Felipe Balbi To: , CC: Linux Kernel Mailing List , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Keerthy , Felipe Balbi Subject: [PATCH 3/3] regulators: tps65218: drop order dependency Date: Tue, 8 Jul 2014 14:09:14 -0500 Message-ID: <1404846554-4095-3-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.0.390.gcb682f8 In-Reply-To: <1404846554-4095-1-git-send-email-balbi@ti.com> References: <1404846554-4095-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.6 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 By just using GCC's array initialization extension, we can easily drop order dependency between tps65218_regulattors enumeration and tps65218_pmic_regs array. Signed-of-by: Felipe Balbi --- drivers/regulator/tps65218-regulator.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 7fc8b3a..b5dc314 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c @@ -49,7 +49,7 @@ enum tps65218_regulators { DCDC1, DCDC2, DCDC3, DCDC4, DCDC5, DCDC6, LDO1 }; } \ #define TPS65218_INFO(_id, _nm, _min, _max) \ - { \ + [_id] = { \ .id = _id, \ .name = _nm, \ .min_uV = _min, \ @@ -72,13 +72,13 @@ static const struct regulator_linear_range dcdc4_ranges[] = { }; static struct tps_info tps65218_pmic_regs[] = { - TPS65218_INFO(0, "DCDC1", 850000, 167500), - TPS65218_INFO(1, "DCDC2", 850000, 1675000), - TPS65218_INFO(2, "DCDC3", 900000, 3400000), - TPS65218_INFO(3, "DCDC4", 1175000, 3400000), - TPS65218_INFO(4, "DCDC5", 1000000, 1000000), - TPS65218_INFO(5, "DCDC6", 1800000, 1800000), - TPS65218_INFO(6, "LDO1", 900000, 3400000), + TPS65218_INFO(DCDC1, "DCDC1", 850000, 167500), + TPS65218_INFO(DCDC2, "DCDC2", 850000, 1675000), + TPS65218_INFO(DCDC3, "DCDC3", 900000, 3400000), + TPS65218_INFO(DCDC4, "DCDC4", 1175000, 3400000), + TPS65218_INFO(DCDC5, "DCDC5", 1000000, 1000000), + TPS65218_INFO(DCDC6, "DCDC6", 1800000, 1800000), + TPS65218_INFO(LDO1, "LDO1", 900000, 3400000), }; #define TPS65218_OF_MATCH(comp, label) \