From patchwork Wed Feb 5 15:35:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Badarkhe X-Patchwork-Id: 3586821 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 3E78E9F392 for ; Wed, 5 Feb 2014 15:38:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6043820163 for ; Wed, 5 Feb 2014 15:38:05 +0000 (UTC) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5603B20117 for ; Wed, 5 Feb 2014 15:38:04 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s15FaT7C005612; Wed, 5 Feb 2014 09:36:29 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s15FaSXY010580; Wed, 5 Feb 2014 09:36:28 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Wed, 5 Feb 2014 09:36:27 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s15FaQFV001366; Wed, 5 Feb 2014 09:36:26 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 2210980627; Wed, 5 Feb 2014 09:36:26 -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 85A2C80626 for ; Wed, 5 Feb 2014 09:36:24 -0600 (CST) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s15FaO80014499 for ; Wed, 5 Feb 2014 09:36:24 -0600 Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id s15FaLuv031445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Feb 2014 09:36:23 -0600 Received: from [216.82.253.147:17053] by server-8.bemta-7.messagelabs.com id A7/FE-07799-57A52F25; Wed, 05 Feb 2014 15:36:21 +0000 X-Env-Sender: badarkhe.manish@gmail.com X-Msg-Ref: server-3.tower-165.messagelabs.com!1391614563!10293265!1 X-Originating-IP: [209.85.220.51] 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 4560 invoked from network); 5 Feb 2014 15:36:04 -0000 Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by server-3.tower-165.messagelabs.com with RC4-SHA encrypted SMTP; 5 Feb 2014 15:36:04 -0000 Received: by mail-pa0-f51.google.com with SMTP id ld10so505714pab.10 for ; Wed, 05 Feb 2014 07:36:03 -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=OQhwXjA3+UJ1JtqdDduPKJ9t9fPNQypyqa71GqcYjNo=; b=la0w0zUAqt3DiSVvs3x52n9d3MXq2zOLkYg5oL9fYFQhTi3+zp1sc7cozRSxt/jhzP eher5AdT9m09GQbosVGp/liErwl0wQ+VHY/KPJfW8CRNwkvvQml/EX+DRnIcbEIWjiHw H09vf0UDjOb88mDiZgluee2zUYhRP8vmZ6WgzmchglWCdIVNq4hFkD1dccU0NszwllLI 9sAMd1LUyypY7k4WHBkY513ZTKrumbSf3dLybyUguLVAlu7mPz+lNDEgXZHQpmn2NizD jTLwvA7wr1Pmcmly/aqRb1HDJeP8yXKh62P/a5bEK20r0utulVLeUwQv6SOpHqY/uY8P 1maA== X-Received: by 10.68.240.36 with SMTP id vx4mr2632301pbc.140.1391614563647; Wed, 05 Feb 2014 07:36:03 -0800 (PST) Received: from manish-HP-Pavilion-dv4-Notebook-PC.connectify ([113.193.151.204]) by mx.google.com with ESMTPSA id nm5sm77733818pbc.29.2014.02.05.07.36.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 07:36:03 -0800 (PST) From: Manish Badarkhe To: , Subject: [PATCH] regulator: tps6507x: Use "IS_ENABLED" for DT code. Date: Wed, 5 Feb 2014 21:05:51 +0530 Message-ID: <1391614551-20385-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@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 --- :100644 100644 162a0fa... 97868b7... M drivers/regulator/tps6507x-regulator.c drivers/regulator/tps6507x-regulator.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 162a0fa..97868b7 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c @@ -367,6 +367,7 @@ static struct of_regulator_match tps6507x_matches[] = { { .name = "LDO1"}, { .name = "LDO2"}, }; +#endif static struct tps6507x_board *tps6507x_parse_dt_reg_data( struct platform_device *pdev, @@ -424,15 +425,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 +446,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 +475,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; }