Skip to contentSkip to conversation

staging: iio: ad9832: move ad9832_platform_data into include/linux/lib

PATCH In review Taimoor Zaeem 3 participants 5 messages Oct 5, 2025 – Oct 6, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: iio: ad9832: move ad9832_platform_data into include/linux/lib

Move struct ad9832_platform_data from
drivers/staging/iio/frequency/ad9832.h to
include/linux/iio/frequency/ad9832.h.

This clears a TODO item in the drivers.

---
 drivers/staging/iio/frequency/ad9832.c                    | 3 +--
 {drivers/staging => include/linux}/iio/frequency/ad9832.h | 4 ----
 2 files changed, 1 insertion(+), 6 deletions(-)
 rename {drivers/staging => include/linux}/iio/frequency/ad9832.h (91%)
drivers/staging/iio/frequency/ad9832.c +1 -2
index 49388da5a684..76bc384dfad1 100644
@@ -22,8 +22,7 @@
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
-
-#include "ad9832.h"
+#include <linux/iio/frequency/ad9832.h>
 
 #include "dds.h"
 
include/linux/iio/frequency/ad9832.h renamed from drivers/staging/iio/frequency/ad9832.h +0 -4
similarity index 91%
rename from drivers/staging/iio/frequency/ad9832.h
rename to include/linux/iio/frequency/ad9832.h
index d0d840edb8d2..81c97a521812 100644
@@ -7,10 +7,6 @@
 #ifndef IIO_DDS_AD9832_H_
 #define IIO_DDS_AD9832_H_
 
-/*
- * TODO: struct ad9832_platform_data needs to go into include/linux/iio
- */
-
 /**
  * struct ad9832_platform_data - platform specific information
  * @freq0:		power up freq0 tuning word in Hz
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 5 lines · Taimoor Zaeem

Move struct ad9832_platform_data from
drivers/staging/iio/frequency/ad9832.h to
include/linux/iio/frequency/ad9832.h.

This clears a TODO item in the drivers.

No, this should only happen when the whole driver moves out of drivers/staging/, staging drivers shoul dbe self-contained.

Also, why is a .h file needed for just one file anyway? Shouldn't this be part of the .c file instead?

thanks,

greg k-h

#2 lore raw
Quoted 2 lines

No, this should only happen when the whole driver moves out of drivers/staging/, staging drivers shoul dbe self-contained.

Right, I see.

Quoted 2 lines

Also, why is a .h file needed for just one file anyway? Shouldn't this be part of the .c file instead?

Not sure what's the convention here, but yes it could be part of .c instead. There is another .h file in the same directory (ad9834.h) which is basically empty. Should we remove that too?

maintainer
#3 lore raw
Quoted 4 lines · Taimoor Zaeem
Quoted 2 lines

Also, why is a .h file needed for just one file anyway? Shouldn't this be part of the .c file instead?

Not sure what's the convention here, but yes it could be part of .c instead. There is another .h file in the same directory (ad9834.h) which is basically empty. Should we remove that too?

Yes please.

thanks,

greg k-h

#4 lore raw
In reply to Greg KH
Quoted 5 lines · On Sun, 5 Oct 2025 16:00:33 +0200 Greg KH <[email protected]> wrote:
Quoted 4 lines · Taimoor Zaeem

Move struct ad9832_platform_data from
drivers/staging/iio/frequency/ad9832.h to
include/linux/iio/frequency/ad9832.h.

Quoted 7 lines
Quoted 1 line

This clears a TODO item in the drivers.

No, this should only happen when the whole driver moves out of drivers/staging/, staging drivers shoul dbe self-contained.

Also, why is a .h file needed for just one file anyway? Shouldn't this be part of the .c file instead?

It's an old school board file / platform data definition.

So it would be fine to get rid of that entirely and move the driver to appropriate modern firmware interfaces but if we keep the struct definition it doesn't make sense to move it into the C file.

I'm edging closer to just posting a series to get rid of these remaining IIO drivers in staging, but normally I've only done that when the parts have gone out of production as until that point it seems reasonable that they might eventually get cleaned up, ABI fixed etc and the costs of keeping them around are low.

Nuno, can you see if you can get a view from ADI on whether there will ever be any effort to sort these ancient drivers out? I appreciate that may be challenging to answer though.

Jonathan

Quoted 5 lines

thanks,

greg k-h