Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: chipidea: core: wrap ci_handle_power_lost() with CONFIG_PM_SLEEP

If CONFIG_PM_SLEEP is not set, the following error will be shown up
when build kernel:
error: 'ci_handle_power_lost' defined but not used.

This will move ci_handle_power_lost() to an area wrapped by
CONFIG_PM_SLEEP.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Fixes: 74494b33211d ("usb: chipidea: core: add controller resume support when controller is powered off")
Reported-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20221026121157.1491302-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xu Yang and committed by
Greg Kroah-Hartman
dced8892 77ece812

+19 -19
+19 -19
drivers/usb/chipidea/core.c
··· 661 661 return role; 662 662 } 663 663 664 - static void ci_handle_power_lost(struct ci_hdrc *ci) 665 - { 666 - enum ci_role role; 667 - 668 - disable_irq_nosync(ci->irq); 669 - if (!ci_otg_is_fsm_mode(ci)) { 670 - role = ci_get_role(ci); 671 - 672 - if (ci->role != role) { 673 - ci_handle_id_switch(ci); 674 - } else if (role == CI_ROLE_GADGET) { 675 - if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV)) 676 - usb_gadget_vbus_connect(&ci->gadget); 677 - } 678 - } 679 - 680 - enable_irq(ci->irq); 681 - } 682 - 683 664 static struct usb_role_switch_desc ci_role_switch = { 684 665 .set = ci_usb_role_switch_set, 685 666 .get = ci_usb_role_switch_get, ··· 1379 1398 ci_controller_suspend(ci); 1380 1399 1381 1400 return 0; 1401 + } 1402 + 1403 + static void ci_handle_power_lost(struct ci_hdrc *ci) 1404 + { 1405 + enum ci_role role; 1406 + 1407 + disable_irq_nosync(ci->irq); 1408 + if (!ci_otg_is_fsm_mode(ci)) { 1409 + role = ci_get_role(ci); 1410 + 1411 + if (ci->role != role) { 1412 + ci_handle_id_switch(ci); 1413 + } else if (role == CI_ROLE_GADGET) { 1414 + if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV)) 1415 + usb_gadget_vbus_connect(&ci->gadget); 1416 + } 1417 + } 1418 + 1419 + enable_irq(ci->irq); 1382 1420 } 1383 1421 1384 1422 static int ci_resume(struct device *dev)