Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756080Ab3I3QDn (ORCPT ); Mon, 30 Sep 2013 12:03:43 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:1837 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755742Ab3I3QDl (ORCPT ); Mon, 30 Sep 2013 12:03:41 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 30 Sep 2013 08:59:51 -0700 Message-ID: <5249A0DC.9030206@nvidia.com> Date: Mon, 30 Sep 2013 12:03:40 -0400 From: Rhyland Klein User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Manish Badarkhe CC: "linux-tegra@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "anton@enomsg.org" , "dwmw2@infradead.org" Subject: Re: [PATCH] tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT code. References: <1380342744-4227-1-git-send-email-badarkhe.manish@gmail.com> In-Reply-To: <1380342744-4227-1-git-send-email-badarkhe.manish@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2529 Lines: 81 On 9/28/2013 12:32 AM, Manish Badarkhe wrote: > Instead of "#if defined(CONFIG_OF)" use "IS_ENABLED(CONFIG_OF)" option > for DT code to avoid if-deffery in code. > Also, arranged header files in alphabetically. > > Signed-off-by: Manish Badarkhe > --- > :100644 100644 bdd7b9b... 8b9c406... M drivers/power/tps65090-charger.c > drivers/power/tps65090-charger.c | 19 +++++-------------- > 1 file changed, 5 insertions(+), 14 deletions(-) > > diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c > index bdd7b9b..8b9c406 100644 > --- a/drivers/power/tps65090-charger.c > +++ b/drivers/power/tps65090-charger.c > @@ -15,15 +15,17 @@ > * You should have received a copy of the GNU General Public License > * along with this program. If not, see . > */ > +#include > #include > #include > #include > #include > #include > -#include > -#include > +#include > #include > #include > +#include > + > #include > > #define TPS65090_REG_INTR_STS 0x00 > @@ -185,10 +187,6 @@ static irqreturn_t tps65090_charger_isr(int irq, void *dev_id) > return IRQ_HANDLED; > } > > -#if defined(CONFIG_OF) > - > -#include > - > static struct tps65090_platform_data * > tps65090_parse_dt_charger_data(struct platform_device *pdev) > { > @@ -210,13 +208,6 @@ static struct tps65090_platform_data * > return pdata; > > } > -#else > -static struct tps65090_platform_data * > - tps65090_parse_dt_charger_data(struct platform_device *pdev) > -{ > - return NULL; > -} > -#endif > > static int tps65090_charger_probe(struct platform_device *pdev) > { > @@ -228,7 +219,7 @@ static int tps65090_charger_probe(struct platform_device *pdev) > > pdata = dev_get_platdata(pdev->dev.parent); > > - if (!pdata && pdev->dev.of_node) > + if (IS_ENABLED(CONFIG_OF) && !pdata && pdev->dev.of_node) > pdata = tps65090_parse_dt_charger_data(pdev); > > if (!pdata) { > LGTM Acked-by: Rhyland Klein -- nvpublic -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/