platform: tegra: bwmgr: Fix debug macro build

When NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined the build
fails and the following errors are seen ...

 drivers/platform/tegra/tegra-bpmp-bwmgr.c:101:12: error:
  ‘tegra_bpmp_bwmgr_devfreq_target’ defined but not used
  [-Werror=unused-function]
  101 | static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev,
                                       unsigned long *freq, u32 flags)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 drivers/platform/tegra/tegra-bpmp-bwmgr.c:37:12: error:
  ‘tegra_bpmp_bwmgr_max_freq_notifier’ defined but not used
  [-Werror=unused-function]
   37 | static int tegra_bpmp_bwmgr_max_freq_notifier(struct
                  notifier_block *nb, unsigned long action, void *ptr)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by ensuring the above functions are not defined if
NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined.

Bug 5483386
Bug 5196455

Change-Id: Ie2b069d163a32220c95ffaba217ddea3686ba92b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461865
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2025-10-01 11:27:27 +01:00
committed by mobile promotions
parent 099e5e1cd7
commit a3097907b3

View File

@@ -34,6 +34,7 @@ struct tegra_bpmp_bwmgr {
struct tegra_bpmp *bpmp; struct tegra_bpmp *bpmp;
}; };
#if defined(NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT)
static int tegra_bpmp_bwmgr_max_freq_notifier(struct notifier_block *nb, unsigned long action, void *ptr) static int tegra_bpmp_bwmgr_max_freq_notifier(struct notifier_block *nb, unsigned long action, void *ptr)
{ {
struct tegra_bpmp_bwmgr *bwmgr = container_of(nb, struct tegra_bpmp_bwmgr, max_freq_nb); struct tegra_bpmp_bwmgr *bwmgr = container_of(nb, struct tegra_bpmp_bwmgr, max_freq_nb);
@@ -71,6 +72,7 @@ static int tegra_bpmp_bwmgr_max_freq_notifier(struct notifier_block *nb, unsigne
return err; return err;
} }
#endif
static int devfreq_gov_bwmgr_target_freq(struct devfreq *df, unsigned long *freq) static int devfreq_gov_bwmgr_target_freq(struct devfreq *df, unsigned long *freq)
{ {
@@ -98,6 +100,7 @@ static struct devfreq_governor devfreq_gov_bwmgr = {
.event_handler = devfreq_gov_bwmgr_event_handler, .event_handler = devfreq_gov_bwmgr_event_handler,
}; };
#if defined(NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT)
static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *freq, u32 flags)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
@@ -112,9 +115,7 @@ static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *fr
bwmgr_req.cmd = CMD_BWMGR_INT_CALC_AND_SET; bwmgr_req.cmd = CMD_BWMGR_INT_CALC_AND_SET;
bwmgr_req.bwmgr_calc_set_req.mc_floor = khz; bwmgr_req.bwmgr_calc_set_req.mc_floor = khz;
bwmgr_req.bwmgr_calc_set_req.floor_unit = BWMGR_INT_UNIT_KHZ; bwmgr_req.bwmgr_calc_set_req.floor_unit = BWMGR_INT_UNIT_KHZ;
#if defined(NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT)
bwmgr_req.bwmgr_calc_set_req.client_id = TEGRA264_BWMGR_DEBUG; bwmgr_req.bwmgr_calc_set_req.client_id = TEGRA264_BWMGR_DEBUG;
#endif
msg.mrq = MRQ_BWMGR_INT; msg.mrq = MRQ_BWMGR_INT;
msg.tx.data = &bwmgr_req; msg.tx.data = &bwmgr_req;
@@ -135,6 +136,7 @@ static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *fr
return 0; return 0;
} }
#endif
static int tegra_bpmp_bwmgr_devfreq_register(struct tegra_bpmp_bwmgr *bwmgr) static int tegra_bpmp_bwmgr_devfreq_register(struct tegra_bpmp_bwmgr *bwmgr)
{ {