diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-08-23 08:34:33 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2011-08-23 09:31:52 -0400 |
commit | 1c74529dbecf8839d3ed360690f937d68c14e55b (patch) | |
tree | 22ff0ecdec593c6f613f75944bd79e2ccdadd888 /drivers/power/pda_power.c | |
parent | cf7a8c03db792894f436db5f3ffc44d947b9b068 (diff) |
pda_power: Fix build error if !CONFIG_USB_OTG_UTILS
commit 9ad63986c606c60e2e916b1b96f22991f966d9cc
"pda_power: Add support for using otg transceiver events"
introduces below build error if !CONFIG_USB_OTG_UTILS.
CC drivers/power/pda_power.o
drivers/power/pda_power.c: In function 'pda_power_probe':
drivers/power/pda_power.c:322: error: 'otg_is_usb_online' undeclared (first use in this function)
drivers/power/pda_power.c:322: error: (Each undeclared identifier is reported only once
drivers/power/pda_power.c:322: error: for each function it appears in.)
drivers/power/pda_power.c:325: error: 'otg_is_ac_online' undeclared (first use in this function)
drivers/power/pda_power.c:371: error: 'otg_handle_notification' undeclared (first use in this function)
make[2]: *** [drivers/power/pda_power.o] Error 1
make[1]: *** [drivers/power] Error 2
make: *** [drivers] Error 2
This patch adds #ifdef CONFIG_USB_OTG_UTILS guards at necessary places to fix
build errors.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power/pda_power.c')
-rw-r--r-- | drivers/power/pda_power.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c index 81b720107c3a..87be6795605a 100644 --- a/drivers/power/pda_power.c +++ b/drivers/power/pda_power.c | |||
@@ -39,8 +39,11 @@ static struct timer_list supply_timer; | |||
39 | static struct timer_list polling_timer; | 39 | static struct timer_list polling_timer; |
40 | static int polling; | 40 | static int polling; |
41 | 41 | ||
42 | #ifdef CONFIG_USB_OTG_UTILS | ||
42 | static struct otg_transceiver *transceiver; | 43 | static struct otg_transceiver *transceiver; |
43 | static struct notifier_block otg_nb; | 44 | static struct notifier_block otg_nb; |
45 | #endif | ||
46 | |||
44 | static struct regulator *ac_draw; | 47 | static struct regulator *ac_draw; |
45 | 48 | ||
46 | enum { | 49 | enum { |
@@ -317,6 +320,7 @@ static int pda_power_probe(struct platform_device *pdev) | |||
317 | ret = PTR_ERR(ac_draw); | 320 | ret = PTR_ERR(ac_draw); |
318 | } | 321 | } |
319 | 322 | ||
323 | #ifdef CONFIG_USB_OTG_UTILS | ||
320 | transceiver = otg_get_transceiver(); | 324 | transceiver = otg_get_transceiver(); |
321 | if (transceiver && !pdata->is_usb_online) { | 325 | if (transceiver && !pdata->is_usb_online) { |
322 | pdata->is_usb_online = otg_is_usb_online; | 326 | pdata->is_usb_online = otg_is_usb_online; |
@@ -324,6 +328,7 @@ static int pda_power_probe(struct platform_device *pdev) | |||
324 | if (transceiver && !pdata->is_ac_online) { | 328 | if (transceiver && !pdata->is_ac_online) { |
325 | pdata->is_ac_online = otg_is_ac_online; | 329 | pdata->is_ac_online = otg_is_ac_online; |
326 | } | 330 | } |
331 | #endif | ||
327 | 332 | ||
328 | if (pdata->is_ac_online) { | 333 | if (pdata->is_ac_online) { |
329 | ret = power_supply_register(&pdev->dev, &pda_psy_ac); | 334 | ret = power_supply_register(&pdev->dev, &pda_psy_ac); |
@@ -367,6 +372,7 @@ static int pda_power_probe(struct platform_device *pdev) | |||
367 | } | 372 | } |
368 | } | 373 | } |
369 | 374 | ||
375 | #ifdef CONFIG_USB_OTG_UTILS | ||
370 | if (transceiver && pdata->use_otg_notifier) { | 376 | if (transceiver && pdata->use_otg_notifier) { |
371 | otg_nb.notifier_call = otg_handle_notification; | 377 | otg_nb.notifier_call = otg_handle_notification; |
372 | ret = otg_register_notifier(transceiver, &otg_nb); | 378 | ret = otg_register_notifier(transceiver, &otg_nb); |
@@ -376,6 +382,7 @@ static int pda_power_probe(struct platform_device *pdev) | |||
376 | } | 382 | } |
377 | polling = 0; | 383 | polling = 0; |
378 | } | 384 | } |
385 | #endif | ||
379 | 386 | ||
380 | if (polling) { | 387 | if (polling) { |
381 | dev_dbg(dev, "will poll for status\n"); | 388 | dev_dbg(dev, "will poll for status\n"); |
@@ -389,17 +396,21 @@ static int pda_power_probe(struct platform_device *pdev) | |||
389 | 396 | ||
390 | return 0; | 397 | return 0; |
391 | 398 | ||
399 | #ifdef CONFIG_USB_OTG_UTILS | ||
392 | otg_reg_notifier_failed: | 400 | otg_reg_notifier_failed: |
393 | if (pdata->is_usb_online && usb_irq) | 401 | if (pdata->is_usb_online && usb_irq) |
394 | free_irq(usb_irq->start, &pda_psy_usb); | 402 | free_irq(usb_irq->start, &pda_psy_usb); |
403 | #endif | ||
395 | usb_irq_failed: | 404 | usb_irq_failed: |
396 | if (pdata->is_usb_online) | 405 | if (pdata->is_usb_online) |
397 | power_supply_unregister(&pda_psy_usb); | 406 | power_supply_unregister(&pda_psy_usb); |
398 | usb_supply_failed: | 407 | usb_supply_failed: |
399 | if (pdata->is_ac_online && ac_irq) | 408 | if (pdata->is_ac_online && ac_irq) |
400 | free_irq(ac_irq->start, &pda_psy_ac); | 409 | free_irq(ac_irq->start, &pda_psy_ac); |
410 | #ifdef CONFIG_USB_OTG_UTILS | ||
401 | if (transceiver) | 411 | if (transceiver) |
402 | otg_put_transceiver(transceiver); | 412 | otg_put_transceiver(transceiver); |
413 | #endif | ||
403 | ac_irq_failed: | 414 | ac_irq_failed: |
404 | if (pdata->is_ac_online) | 415 | if (pdata->is_ac_online) |
405 | power_supply_unregister(&pda_psy_ac); | 416 | power_supply_unregister(&pda_psy_ac); |