From 713d5a769d3185c3cd75068fd31fa55eb6753926 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Fri, 27 May 2022 17:07:01 +0800 Subject: [PATCH] soc: rockchip: io-domain: fix module compile error Fix compile error when build to module: ERROR: modpost: "of_find_regulator_by_node" [drivers/soc/rockchip/io-domain.ko] undefined! Fixes: bc2ba01c8835 ("soc: rockchip: io-domain: dump power supply-map when probe") Signed-off-by: Jianqun Xu Change-Id: I38490ed4129b500c3b3828c4f689a93c7ba93a67 --- drivers/soc/rockchip/io-domain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/soc/rockchip/io-domain.c b/drivers/soc/rockchip/io-domain.c index ad5fc6649969..ae0a0fd58a95 100644 --- a/drivers/soc/rockchip/io-domain.c +++ b/drivers/soc/rockchip/io-domain.c @@ -638,6 +638,7 @@ static const struct of_device_id rockchip_iodomain_match[] = { }; MODULE_DEVICE_TABLE(of, rockchip_iodomain_match); +#ifndef MODULE static const char *rdev_get_name(struct regulator_dev *rdev) { if (rdev->constraints && rdev->constraints->name) @@ -708,6 +709,13 @@ static void rockchip_iodomain_dump(const struct platform_device *pdev, rdev_get_name(r)); } } +#else +static inline void +rockchip_iodomain_dump(const struct platform_device *pdev, + struct rockchip_iodomain_supply *supply) +{ +} +#endif static int rv1126_iodomain_notify(struct notifier_block *nb, unsigned long event,