Skip to content

Commit 080e1f9

Browse files
mtk-rogerluSasha Levin
authored andcommitted
soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported
[ Upstream commit 8bf3050 ] Some projects might not support CONFIG_DEBUG_FS but still needs svs to be alive. Therefore, enclose debug cmd codes with CONFIG_DEBUG_FS to make sure svs can be alive when CONFIG_DEBUG_FS not supported. Signed-off-by: Roger Lu <roger.lu@mediatek.com> Link: https://lore.kernel.org/r/20230111074528.29354-8-roger.lu@mediatek.com Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3aeb752 commit 080e1f9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/soc/mediatek/mtk-svs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138

139139
static DEFINE_SPINLOCK(svs_lock);
140140

141+
#ifdef CONFIG_DEBUG_FS
141142
#define debug_fops_ro(name) \
142143
static int svs_##name##_debug_open(struct inode *inode, \
143144
struct file *filp) \
@@ -170,6 +171,7 @@ static DEFINE_SPINLOCK(svs_lock);
170171
}
171172

172173
#define svs_dentry_data(name) {__stringify(name), &svs_##name##_debug_fops}
174+
#endif
173175

174176
/**
175177
* enum svsb_phase - svs bank phase enumeration
@@ -628,6 +630,7 @@ static int svs_adjust_pm_opp_volts(struct svs_bank *svsb)
628630
return ret;
629631
}
630632

633+
#ifdef CONFIG_DEBUG_FS
631634
static int svs_dump_debug_show(struct seq_file *m, void *p)
632635
{
633636
struct svs_platform *svsp = (struct svs_platform *)m->private;
@@ -843,6 +846,7 @@ static int svs_create_debug_cmds(struct svs_platform *svsp)
843846

844847
return 0;
845848
}
849+
#endif /* CONFIG_DEBUG_FS */
846850

847851
static u32 interpolate(u32 f0, u32 f1, u32 v0, u32 v1, u32 fx)
848852
{
@@ -2444,11 +2448,13 @@ static int svs_probe(struct platform_device *pdev)
24442448
goto svs_probe_iounmap;
24452449
}
24462450

2451+
#ifdef CONFIG_DEBUG_FS
24472452
ret = svs_create_debug_cmds(svsp);
24482453
if (ret) {
24492454
dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret);
24502455
goto svs_probe_iounmap;
24512456
}
2457+
#endif
24522458

24532459
return 0;
24542460

0 commit comments

Comments
 (0)