From patchwork Wed Feb 5 18:36:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Badarkhe X-Patchwork-Id: 3588131 Return-Path: X-Original-To: patchwork-davinci@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 60DD09F392 for ; Wed, 5 Feb 2014 18:37:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7465920163 for ; Wed, 5 Feb 2014 18:37:25 +0000 (UTC) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44C8420158 for ; Wed, 5 Feb 2014 18:37:24 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s15IbNqE009001 for ; Wed, 5 Feb 2014 12:37:23 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s15Ib7ve006646 for ; Wed, 5 Feb 2014 12:37:08 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Wed, 5 Feb 2014 12:37:07 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s15Ib7CM021062 for ; Wed, 5 Feb 2014 12:37:07 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 86DFF80627 for ; Wed, 5 Feb 2014 12:37:07 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id 00F3180626 for ; Wed, 5 Feb 2014 12:36:17 -0600 (CST) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s15IaH3J024994 for ; Wed, 5 Feb 2014 12:36:17 -0600 Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id s15IaHUG016529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Feb 2014 12:36:17 -0600 Received: from [216.82.250.51:41801] by server-7.bemta-12.messagelabs.com id 07/92-03943-1A482F25; Wed, 05 Feb 2014 18:36:17 +0000 X-Env-Sender: badarkhe.manish@gmail.com X-Msg-Ref: server-3.tower-108.messagelabs.com!1391625374!9224642!1 X-Originating-IP: [209.85.192.171] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25040 invoked from network); 5 Feb 2014 18:36:15 -0000 Received: from mail-pd0-f171.google.com (HELO mail-pd0-f171.google.com) (209.85.192.171) by server-3.tower-108.messagelabs.com with RC4-SHA encrypted SMTP; 5 Feb 2014 18:36:15 -0000 Received: by mail-pd0-f171.google.com with SMTP id g10so689259pdj.2 for ; Wed, 05 Feb 2014 10:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=8148JrL3HfMbikOl5R28A0K657qWPPU9hrthZla9UrM=; b=m3T+2YDh+B+CyMmhsIt04AivF5HgQP8IIElbR6xvCScFF+21oggVSDPmNWKnJ4AxoZ Y7zrPuU9u3BsxyN97zi/k512DTuali0zFgIolOCs9ExpO9BuHoFtWpgGDPQIEsW2DJFp yYusm7Kit3IRHmVmTznm6OOEhvs9e+KfVP3r3J10Oq7YKONYlS7HfokZLecbZ5Dwvja0 arzI7qW+A2qLfbehPU5xwhivJ5r2x+CJ7ErkjgixewVWe3edyQYaRxEEbsDlCMccaWtJ ehAWruiUzqzyoK9X6nRpEU3wbgxJCThXoX+u9Q5PgYw+0vK7lBoI2DCtnGhwJFWTLeoi FQOA== X-Received: by 10.68.234.230 with SMTP id uh6mr4065797pbc.161.1391625374311; Wed, 05 Feb 2014 10:36:14 -0800 (PST) Received: from manish-HP-Pavilion-dv4-Notebook-PC.connectify ([113.193.151.204]) by mx.google.com with ESMTPSA id rb6sm43287066pbb.41.2014.02.05.10.36.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 10:36:13 -0800 (PST) From: Manish Badarkhe To: , Subject: [PATCH V2] regulator: tps6507x: Use "IS_ENABLED" for DT code. Date: Thu, 6 Feb 2014 00:06:00 +0530 Message-ID: <1391625360-1827-1-git-send-email-badarkhe.manish@gmail.com> X-Mailer: git-send-email 1.7.10.4 CC: , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Instead of "#ifdef CONFIG_OF" use "IS_ENABLED(CONFIG_OF)" option for DT code to avoid if-deffery in code. Also, modify code as per coding style. Signed-off-by: Manish Badarkhe --- Changes since V1: 1. fix build break when CONFIG_OF is not set. :100644 100644 162a0fa... 862cc81... M drivers/regulator/tps6507x-regulator.c drivers/regulator/tps6507x-regulator.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 162a0fa..862cc81 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c @@ -359,7 +359,6 @@ static struct regulator_ops tps6507x_pmic_ops = { .map_voltage = regulator_map_voltage_ascend, }; -#ifdef CONFIG_OF static struct of_regulator_match tps6507x_matches[] = { { .name = "VDCDC1"}, { .name = "VDCDC2"}, @@ -424,15 +423,7 @@ static struct tps6507x_board *tps6507x_parse_dt_reg_data( return tps_board; } -#else -static inline struct tps6507x_board *tps6507x_parse_dt_reg_data( - struct platform_device *pdev, - struct of_regulator_match **tps6507x_reg_matches) -{ - *tps6507x_reg_matches = NULL; - return NULL; -} -#endif + static int tps6507x_pmic_probe(struct platform_device *pdev) { struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); @@ -453,9 +444,10 @@ static int tps6507x_pmic_probe(struct platform_device *pdev) */ tps_board = dev_get_platdata(tps6507x_dev->dev); - if (!tps_board && tps6507x_dev->dev->of_node) + if (IS_ENABLED(CONFIG_OF) && !tps_board && + tps6507x_dev->dev->of_node) tps_board = tps6507x_parse_dt_reg_data(pdev, - &tps6507x_reg_matches); + &tps6507x_reg_matches); if (!tps_board) return -EINVAL; @@ -481,7 +473,7 @@ static int tps6507x_pmic_probe(struct platform_device *pdev) tps->info[i] = info; if (init_data->driver_data) { struct tps6507x_reg_platform_data *data = - init_data->driver_data; + init_data->driver_data; tps->info[i]->defdcdc_default = data->defdcdc_default; }