drivers: Fix build errors with DEBUGFS_FS disabled

When CONFIG_DEBUG_FS is disabled, build errors are seen in the
following 2 drivers:

1. bpmpfw - The build error was seen because bpmp-debugfs.c was
getting compiled even when CONFIG_DEBUG_FS was disabled.

2. ufs - The build error was seen due to a couple of reasons:
- Function debugfs_provision_init is defined in a file that is
protected with CONFIG_DEBUG_FS, but is called from another file
unconditionally.
- In ufs-tegra-common.c, there are calls to debugfs_* functions, but
inclusion of the standard header debugfs.h is protected under
CONFIG_DEBUG_FS.

Fix these issues with this change.

Bug 4164776

Change-Id: Iae6384fd2352e55aed2a0ea85e778be6c26a4d54
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2926891
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Bharat Nihalani
2023-06-26 05:20:05 +00:00
committed by mobile promotions
parent 0da771f275
commit 1f9587aca3
3 changed files with 10 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ obj-m += ivc_ext.o
tegra_bpmp-y += ../../clk/tegra/clk-bpmp.o
tegra_bpmp-y += ../../reset/tegra/reset-bpmp.o
tegra_bpmp-y += ../../soc/tegra/powergate-bpmp.o
tegra_bpmp-y += bpmp-debugfs.o
tegra_bpmp-$(CONFIG_DEBUG_FS) += bpmp-debugfs.o
tegra_bpmp-y += bpmp-tegra186-hv.o
obj-m += tegra_bpmp.o
endif

View File

@@ -17,6 +17,15 @@
#include <linux/debugfs.h>
void debugfs_provision_init(struct ufs_hba *hba, struct dentry *device_root);
void debugfs_provision_exit(struct ufs_hba *hba);
#else
static inline void debugfs_provision_init(struct ufs_hba *hba, struct dentry *device_root)
{
return;
}
static inline void debugfs_provision_exit(struct ufs_hba *hba)
{
return;
}
#endif
#endif

View File

@@ -19,9 +19,7 @@
#include <linux/iommu.h>
#include <linux/pinctrl/consumer.h>
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
#include <drivers-private/scsi/ufs/k515/ufshcd-pltfrm.h>