summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorManish Badarkhe <badarkhe.manish@gmail.com>2013-09-28 10:02:24 +0530
committerAnton Vorontsov <anton@enomsg.org>2013-10-25 16:07:07 -0700
commite47bcba4a189ab1ba23072ee2f457b1d72cd22fe (patch)
tree0590dc31bc0fcea39dc49f5bb0785ec225ef293f /drivers/power
parent0ed81393235fbf9d3379b55d2ceece1885ea3fae (diff)
downloadop-kernel-dev-e47bcba4a189ab1ba23072ee2f457b1d72cd22fe.zip
op-kernel-dev-e47bcba4a189ab1ba23072ee2f457b1d72cd22fe.tar.gz
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 <badarkhe.manish@gmail.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/tps65090-charger.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index 14b6e79..8fc9d6d 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 <http://www.gnu.org/licenses/>.
*/
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
+#include <linux/slab.h>
+
#include <linux/mfd/tps65090.h>
#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 <linux/of_device.h>
-
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) {
OpenPOWER on IntegriCloud