iio: imu: adis16475: drop ifdef around CONFIG_DEBUG_FS
Use IS_ENABLED(CONFIG_DEBUG_FS) to return early in case debugfs is not present. Since this is known at compile time, it allows the compiler to drop any unused code. Therefore no need to wrap the code with #ifdef. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-1-d3adb6996518@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
c5d2291a30
commit
cec920f67e
@@ -164,7 +164,6 @@ module_param(low_rate_allow, bool, 0444);
|
||||
MODULE_PARM_DESC(low_rate_allow,
|
||||
"Allow IMU rates below the minimum advisable when external clk is used in SCALED mode (default: N)");
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
static ssize_t adis16475_show_firmware_revision(struct file *file,
|
||||
char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
@@ -279,6 +278,9 @@ static void adis16475_debugfs_init(struct iio_dev *indio_dev)
|
||||
struct adis16475 *st = iio_priv(indio_dev);
|
||||
struct dentry *d = iio_get_debugfs_dentry(indio_dev);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_DEBUG_FS))
|
||||
return;
|
||||
|
||||
debugfs_create_file_unsafe("serial_number", 0400,
|
||||
d, st, &adis16475_serial_number_fops);
|
||||
debugfs_create_file_unsafe("product_id", 0400,
|
||||
@@ -290,11 +292,6 @@ static void adis16475_debugfs_init(struct iio_dev *indio_dev)
|
||||
debugfs_create_file("firmware_date", 0400, d,
|
||||
st, &adis16475_firmware_date_fops);
|
||||
}
|
||||
#else
|
||||
static void adis16475_debugfs_init(struct iio_dev *indio_dev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static int adis16475_get_freq(struct adis16475 *st, u32 *freq)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user