From: Manish Badarkhe Date: Sat, 28 Sep 2013 04:32:24 +0000 (+0530) Subject: tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT code X-Git-Tag: firefly_0821_release~176^2~4932^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e47bcba4a189ab1ba23072ee2f457b1d72cd22fe;p=firefly-linux-kernel-4.4.55.git tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT code 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 Acked-by: Rhyland Klein Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c index 14b6e79e1fc0..8fc9d6df87f6 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) {