linux-hc-sro4
linux-hc-sro4 copied to clipboard
Replaced class_attrs with class_groups for kernel 4.14
Hi, I encourted an error "unknown field ‘class_attrs’ specified in initializer" during compilation on Raspbian with kernel 4.14.20-v7+ (according to https://www.raspberrypi.org/forums/viewtopic.php?t=205802 I am not alone)
It seemed that class_attrs got deprecated in newer kernel version. I used patch from some other project and did analogical changes to hc-sro4 driver. It got compiled and seems to work on my platform. Could you test it on older version?
Hi, thanks a lot for your patch.
It would, however break compatibility with older kernels.
Please note that meanwhile, newer kernels contain a proper IIO driver for the HC-SR04: see /drivers/iio/proximity/srf04.c I haven't tried it with the hardware (I don't have the hardware any more), but reading from the source I would assume that it is compatible with the HC-SR04.
If you have the hardware, you can try this driver from mainline and please let me know the results, so I can update the documentation.
Thanks a lot,
- Johannes