From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752148Ab1HBHsm (ORCPT ); Tue, 2 Aug 2011 03:48:42 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:45768 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975Ab1HBHsg (ORCPT ); Tue, 2 Aug 2011 03:48:36 -0400 Subject: [PATCH] regulator: tps65023: Remove num_voltages array From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Anuj Aggarwal , Liam Girdwood , Mark Brown Content-Type: text/plain; charset="UTF-8" Date: Tue, 02 Aug 2011 15:48:30 +0800 Message-ID: <1312271310.12639.3.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can get n_voltages for each regulator from table_len of struct tps_info. Signed-off-by: Axel Lin --- drivers/regulator/tps65023-regulator.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index 701a590..dd0c72f 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c @@ -106,10 +106,6 @@ static const u16 LDO2_VSEL_table[] = { 2500, 2800, 3000, 3300, }; -static unsigned int num_voltages[] = {ARRAY_SIZE(VDCDC1_VSEL_table), - 0, 0, ARRAY_SIZE(LDO1_VSEL_table), - ARRAY_SIZE(LDO2_VSEL_table)}; - /* Regulator specific details */ struct tps_info { const char *name; @@ -453,7 +449,7 @@ static int __devinit tps_65023_probe(struct i2c_client *client, tps->desc[i].name = info->name; tps->desc[i].id = i; - tps->desc[i].n_voltages = num_voltages[i]; + tps->desc[i].n_voltages = info->table_len; tps->desc[i].ops = (i > TPS65023_DCDC_3 ? &tps65023_ldo_ops : &tps65023_dcdc_ops); tps->desc[i].type = REGULATOR_VOLTAGE; @@ -519,12 +515,14 @@ static const struct tps_info tps65023_regs[] = { .name = "VDCDC2", .min_uV = 3300000, .max_uV = 3300000, + .table_len = 0, .fixed = 1, }, { .name = "VDCDC3", .min_uV = 1800000, .max_uV = 1800000, + .table_len = 0, .fixed = 1, }, { -- 1.7.4.1