Re: [PATCH v1 1/1] iio: core: Split debugfs routines
From: Joshua Crofts
Date: Tue Nov 24 2026 - 05:51:19 EST
On 24-Nov-26 11:46, Andy Shevchenko wrote:
>> > +static const struct file_operations iio_debugfs_reg_fops = {
>> > + .open = simple_open,
>> > + .read = iio_debugfs_read_reg,
>> > + .write = iio_debugfs_write_reg,
>> > +};
>> > +
>> > +static void iio_device_unregister_debugfs(struct iio_dev *indio_dev)
>>
>> Static here but not in the header file. Same goes for register_debugfs().
>
> Oh, how does it compile?
Unfortunately it doesn't :(
drivers/iio/industrialio-debugfs.c:138:13: error: static declaration of ‘iio_device_unregister_debugfs’ follows non-static declaration
138 | static void iio_device_unregister_debugfs(struct iio_dev *indio_dev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/iio/industrialio-debugfs.c:20:
drivers/iio/iio_core.h:23:6: note: previous declaration of ‘iio_device_unregister_debugfs’ with type ‘void(struct iio_dev *)’
23 | void iio_device_unregister_debugfs(struct iio_dev *indio_dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/industrialio-debugfs.c:145:13: error: static declaration of ‘iio_device_register_debugfs’ follows non-static declaration
145 | static void iio_device_register_debugfs(struct iio_dev *indio_dev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/iio_core.h:24:6: note: previous declaration of ‘iio_device_register_debugfs’ with type ‘void(struct iio_dev *)’
24 | void iio_device_register_debugfs(struct iio_dev *indio_dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/industrialio-debugfs.c:145:13: warning: ‘iio_device_register_debugfs’ defined but not used [-Wunused-function]
145 | static void iio_device_register_debugfs(struct iio_dev *indio_dev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/industrialio-debugfs.c:138:13: warning: ‘iio_device_unregister_debugfs’ defined but not used [-Wunused-function]
138 | static void iio_device_unregister_debugfs(struct iio_dev *indio_dev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:290: drivers/iio/industrialio-debugfs.o] Error 1
--
Kind regards,
Joshua Crofts