diff options
author | Anda-Maria Nicolae <anda-maria.nicolae@intel.com> | 2015-06-03 04:47:03 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-06-03 07:23:55 -0400 |
commit | fb323eccbcaff06c1ed21ab989198eb40df6e846 (patch) | |
tree | 1440dddccea854c83d70c01a8485f7e0d9f0f719 | |
parent | bcd56fe1aa97117f8cfad68280d9aa6d403fd815 (diff) |
power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled
If CONFIG_USB_PHY is not enabled, struct notifier_block is not defined and
compilation fails. Therefore, the functions that process USB event
notifications are defined only if CONFIG_USB_PHY is enabled.
There is no need to define these functions if CONFIG_USB_PHY is not
enabled, since no USB notifications are received in this case.
Also, since rt9455_set_boost_voltage_before_boost_mode() function is
called only if USB_EVENT_ID notification is received, this function should
also be defined only if CONFIG_USB_PHY is enabled.
Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r-- | drivers/power/rt9455_charger.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/rt9455_charger.c b/drivers/power/rt9455_charger.c index 7c0c1ffa84ec..de86913037db 100644 --- a/drivers/power/rt9455_charger.c +++ b/drivers/power/rt9455_charger.c | |||
@@ -804,6 +804,7 @@ static int rt9455_hw_init(struct rt9455_info *info, u32 ichrg, | |||
804 | return 0; | 804 | return 0; |
805 | } | 805 | } |
806 | 806 | ||
807 | #if IS_ENABLED(CONFIG_USB_PHY) | ||
807 | /* | 808 | /* |
808 | * Before setting the charger into boost mode, boost output voltage is | 809 | * Before setting the charger into boost mode, boost output voltage is |
809 | * set. This is needed because boost output voltage may differ from battery | 810 | * set. This is needed because boost output voltage may differ from battery |
@@ -828,6 +829,7 @@ static int rt9455_set_boost_voltage_before_boost_mode(struct rt9455_info *info) | |||
828 | 829 | ||
829 | return 0; | 830 | return 0; |
830 | } | 831 | } |
832 | #endif | ||
831 | 833 | ||
832 | /* | 834 | /* |
833 | * Before setting the charger into charge mode, battery regulation voltage is | 835 | * Before setting the charger into charge mode, battery regulation voltage is |
@@ -1241,6 +1243,7 @@ static int rt9455_discover_charger(struct rt9455_info *info, u32 *ichrg, | |||
1241 | return 0; | 1243 | return 0; |
1242 | } | 1244 | } |
1243 | 1245 | ||
1246 | #if IS_ENABLED(CONFIG_USB_PHY) | ||
1244 | static int rt9455_usb_event_none(struct rt9455_info *info, | 1247 | static int rt9455_usb_event_none(struct rt9455_info *info, |
1245 | u8 opa_mode, u8 iaicr) | 1248 | u8 opa_mode, u8 iaicr) |
1246 | { | 1249 | { |
@@ -1445,6 +1448,7 @@ static int rt9455_usb_event(struct notifier_block *nb, | |||
1445 | } | 1448 | } |
1446 | return NOTIFY_DONE; | 1449 | return NOTIFY_DONE; |
1447 | } | 1450 | } |
1451 | #endif | ||
1448 | 1452 | ||
1449 | static void rt9455_pwr_rdy_work_callback(struct work_struct *work) | 1453 | static void rt9455_pwr_rdy_work_callback(struct work_struct *work) |
1450 | { | 1454 | { |