Re: [PATCH v1 1/1] iio: core: Split debugfs routines

From: Andy Shevchenko

Date: Tue Nov 24 2026 - 05:46:30 EST


On Tue, Nov 24, 2026 at 11:17:01AM +0100, Joshua Crofts wrote:
> On 24-Nov-26 10:44, Andy Shevchenko wrote:

Thanks for the review, my replies below.

...

> > +#if defined(CONFIG_DEBUG_FS)
>
> Veeery small nit, but why not #ifdef CONFIG_DEBUG_FS? It's not
> as if you're checking for multiple defines.

Or even IS_ENABLED()? Let me check if we have a precedent in IIO, I will use
then the same or most used style.

> > +void iio_debugfs_create(void);
> > +void iio_debugfs_remove(void);
> > +
> > +void iio_device_unregister_debugfs(struct iio_dev *indio_dev);
> > +void iio_device_register_debugfs(struct iio_dev *indio_dev);
> > +#else
> > +static inline void iio_debugfs_create(void) {}
> > +static inline void iio_debugfs_remove(void) {}
> > +
> > +static void iio_device_register_debugfs(struct iio_dev *indio_dev) {}
> > +static void iio_device_unregister_debugfs(struct iio_dev *indio_dev) {}
> > +#endif /* CONFIG_DEBUG_FS */
> > +
> > extern const struct device_type iio_device_type;

...

> > +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?

--
With Best Regards,
Andy Shevchenko