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: 33248 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F95020969 for ; Tue, 8 Jul 2014 19:10:42 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id y10sf41140380pdj.5 for ; Tue, 08 Jul 2014 12:10:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=t5oJjpfK74CwPSeNTO9qdy4Gekey4Jru9G+zoa16SrY=; b=BQoKDqzPQ0UUvDCaSrPEdmjVzsFDBbSDq8aTBXByn7PNg9t5a6DqRIfdl0/WOSUtCY iD2H2gR4ScD4fGUYljthqKSe+s1D2R3gC/zBIGCLqPo0heG9mR3LsclWb/YRAYTjfAds 0HrdF3uBzcF/fa103R6LQsNZJjL2rd/a96XQ2kFeMY5VmKa6aImzihR7BWupa7hde2yo d5O9W2V1fHScrNjvlp5NseO0qgIHEnmlL0tE9In6t4nEbqlEx7cXO2okkxbdn2+IakMS KK0B4Re2XFfOcmL0VfITdQ6x9cHYR+BtpnsZJ1F2T6mKhcMx/oFI/Z230ctQHuQqFDov JdjQ== X-Gm-Message-State: ALoCoQm38XKhPcOv1YWfU4GqRkwRQobGUt2HuW19UWhSiBKm9GUgTt7tnSBmrdazSPmpZar/1rJq X-Received: by 10.70.48.66 with SMTP id j2mr3575518pdn.9.1404846641772; Tue, 08 Jul 2014 12:10:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.147 with SMTP id l19ls1211358qgl.42.gmail; Tue, 08 Jul 2014 12:10:41 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr35296841vcb.3.1404846641681; Tue, 08 Jul 2014 12:10:41 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id xq1si17861678vec.20.2014.07.08.12.10.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 12:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id il7so5862635vcb.41 for ; Tue, 08 Jul 2014 12:10:41 -0700 (PDT) X-Received: by 10.58.209.7 with SMTP id mi7mr10974vec.80.1404846641609; Tue, 08 Jul 2014 12:10:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp798299vcb; Tue, 8 Jul 2014 12:10:41 -0700 (PDT) X-Received: by 10.68.134.98 with SMTP id pj2mr36687290pbb.98.1404846640833; Tue, 08 Jul 2014 12:10:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rd10si6403241pdb.297.2014.07.08.12.10.40; Tue, 08 Jul 2014 12:10:40 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755953AbaGHTKE (ORCPT + 27 others); Tue, 8 Jul 2014 15:10:04 -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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) \