From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755290Ab2FNCXI (ORCPT ); Wed, 13 Jun 2012 22:23:08 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:36481 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755096Ab2FNCXF (ORCPT ); Wed, 13 Jun 2012 22:23:05 -0400 Message-ID: <1339640579.16332.2.camel@phoenix> Subject: [PATCH] regulator: tps65023: Set n_voltages to 1 for fixed voltage From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Anuj Aggarwal , Mark Brown , Liam Girdwood Date: Thu, 14 Jun 2012 10:22:59 +0800 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For fixed voltage, the n_voltages should be 1 rather than 0. Signed-off-by: Axel Lin --- drivers/regulator/tps65023-regulator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index f841bd0..df8b70d 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c @@ -324,7 +324,10 @@ 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 = info->table_len; + if (info->fixed) + tps->desc[i].n_voltages = 1; + else + 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; -- 1.7.9.5