mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
power: supply: core: provide function stubs if CONFIG_POWER_SUPPLY=n
Fix build error when CONFIG_POWER_SUPPLY is not enabled. The build error occurs in mips (cavium_octeon_defconfig). mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_remove': drivers/usb/dwc3/core.c:1657: undefined reference to `power_supply_put' mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_get_properties': drivers/usb/dwc3/core.c:1270: undefined reference to `power_supply_get_by_name' mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_probe': drivers/usb/dwc3/core.c:1632: undefined reference to `power_supply_put' Fixes: 59fa3def35de ("usb: dwc3: add a power supply for current control") Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Ray Chi <raychi@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
2552e38dc8
commit
f38a164483
1 changed files with 6 additions and 0 deletions
|
@ -381,8 +381,14 @@ struct power_supply_battery_info {
|
|||
extern struct atomic_notifier_head power_supply_notifier;
|
||||
extern int power_supply_reg_notifier(struct notifier_block *nb);
|
||||
extern void power_supply_unreg_notifier(struct notifier_block *nb);
|
||||
#if IS_ENABLED(CONFIG_POWER_SUPPLY)
|
||||
extern struct power_supply *power_supply_get_by_name(const char *name);
|
||||
extern void power_supply_put(struct power_supply *psy);
|
||||
#else
|
||||
static inline void power_supply_put(struct power_supply *psy) {}
|
||||
static inline struct power_supply *power_supply_get_by_name(const char *name)
|
||||
{ return NULL; }
|
||||
#endif
|
||||
#ifdef CONFIG_OF
|
||||
extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
|
||||
const char *property);
|
||||
|
|
Loading…
Reference in a new issue