Commit c21161e4 authored by Ray Chi's avatar Ray Chi Committed by Greg Kroah-Hartman

power: supply: Fix build error when CONFIG_POWER_SUPPLY is not enabled.

The build error happens when CONFIG_POWER_SUPPLY is not enabled.

h8300-linux-ld: drivers/usb/dwc3/gadget.o: in function `.L59':
>> gadget.c:(.text+0x655): undefined reference to `power_supply_set_property'

Fixes: 99288de3 ("usb: dwc3: add an alternate path in vbus_draw callback")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarRay Chi <raychi@google.com>
Link: https://lore.kernel.org/r/20210327182809.1814480-3-raychi@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a5b5c3c
...@@ -426,9 +426,16 @@ static inline int power_supply_is_system_supplied(void) { return -ENOSYS; } ...@@ -426,9 +426,16 @@ static inline int power_supply_is_system_supplied(void) { return -ENOSYS; }
extern int power_supply_get_property(struct power_supply *psy, extern int power_supply_get_property(struct power_supply *psy,
enum power_supply_property psp, enum power_supply_property psp,
union power_supply_propval *val); union power_supply_propval *val);
#if IS_ENABLED(CONFIG_POWER_SUPPLY)
extern int power_supply_set_property(struct power_supply *psy, extern int power_supply_set_property(struct power_supply *psy,
enum power_supply_property psp, enum power_supply_property psp,
const union power_supply_propval *val); const union power_supply_propval *val);
#else
static inline int power_supply_set_property(struct power_supply *psy,
enum power_supply_property psp,
const union power_supply_propval *val)
{ return 0; }
#endif
extern int power_supply_property_is_writeable(struct power_supply *psy, extern int power_supply_property_is_writeable(struct power_supply *psy,
enum power_supply_property psp); enum power_supply_property psp);
extern void power_supply_external_power_changed(struct power_supply *psy); extern void power_supply_external_power_changed(struct power_supply *psy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment