aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorManish Badarkhe <badarkhe.manish@gmail.com>2013-09-28 00:32:24 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-10-25 19:07:07 -0400
commite47bcba4a189ab1ba23072ee2f457b1d72cd22fe (patch)
tree0590dc31bc0fcea39dc49f5bb0785ec225ef293f /drivers/power
parent0ed81393235fbf9d3379b55d2ceece1885ea3fae (diff)
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 14b6e79e1fc0..8fc9d6df87f6 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -15,15 +15,17 @@
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18#include <linux/delay.h>
18#include <linux/err.h> 19#include <linux/err.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/interrupt.h> 21#include <linux/interrupt.h>
21#include <linux/kernel.h> 22#include <linux/kernel.h>
22#include <linux/module.h> 23#include <linux/module.h>
23#include <linux/slab.h> 24#include <linux/of_device.h>
24#include <linux/delay.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/power_supply.h> 26#include <linux/power_supply.h>
27#include <linux/slab.h>
28
27#include <linux/mfd/tps65090.h> 29#include <linux/mfd/tps65090.h>
28 30
29#define TPS65090_REG_INTR_STS 0x00 31#define TPS65090_REG_INTR_STS 0x00
@@ -185,10 +187,6 @@ static irqreturn_t tps65090_charger_isr(int irq, void *dev_id)
185 return IRQ_HANDLED; 187 return IRQ_HANDLED;
186} 188}
187 189
188#if defined(CONFIG_OF)
189
190#include <linux/of_device.h>
191
192static struct tps65090_platform_data * 190static struct tps65090_platform_data *
193 tps65090_parse_dt_charger_data(struct platform_device *pdev) 191 tps65090_parse_dt_charger_data(struct platform_device *pdev)
194{ 192{
@@ -210,13 +208,6 @@ static struct tps65090_platform_data *
210 return pdata; 208 return pdata;
211 209
212} 210}
213#else
214static struct tps65090_platform_data *
215 tps65090_parse_dt_charger_data(struct platform_device *pdev)
216{
217 return NULL;
218}
219#endif
220 211
221static int tps65090_charger_probe(struct platform_device *pdev) 212static int tps65090_charger_probe(struct platform_device *pdev)
222{ 213{
@@ -228,7 +219,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
228 219
229 pdata = dev_get_platdata(pdev->dev.parent); 220 pdata = dev_get_platdata(pdev->dev.parent);
230 221
231 if (!pdata && pdev->dev.of_node) 222 if (IS_ENABLED(CONFIG_OF) && !pdata && pdev->dev.of_node)
232 pdata = tps65090_parse_dt_charger_data(pdev); 223 pdata = tps65090_parse_dt_charger_data(pdev);
233 224
234 if (!pdata) { 225 if (!pdata) {