Error while compiling customised i2c driver in OpenWrt 23.05 with dependent package kmod-i2c-mux-pca954x

In Openwrt 23.05, I am integrating our customised i2c driver which depends on kmod-i2c-mux-pca954x kernel module. I have included this KO as dependent in our i2c package manifest file. When I try to compile the i2c package, am gettign these compilation errors. Any idea on how to resolve this?


  CC [M]  /home/cmuthusamy/LATEST_CHECK/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/vsat-i2c/vsat-i2c.o
/home/cmuthusamy/LATEST_CHECK/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/vsat-i2c/vsat-i2c.c: In function 'new_mux_board_in
fo':
/home/cmuthusamy/LATEST_CHECK/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/vsat-i2c/vsat-i2c.c:69:34: error: invalid applicat
ion of 'sizeof' to incomplete type 'struct pca954x_platform_data'
   69 |     plat_data = kzalloc( sizeof( struct pca954x_platform_data ), GFP_KERNEL );
      |                                  ^~~~~~
/home/cmuthusamy/LATEST_CHECK/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/vsat-i2c/vsat-i2c.c:77:14: error: invalid use of u
ndefined type 'struct pca954x_platform_data'
   77 |     plat_data->num_modes = NUM_CHANNELS;
      |              ^~
/home/cmuthusamy/LATEST_CHECK/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/vsat-i2c/vsat-i2c.c:79:44: error: invalid applicat
ion of 'sizeof' to incomplete type 'struct pca954x_platform_mode'
   79 |     modes = kcalloc( NUM_CHANNELS, sizeof( struct pca954x_platform_mode ), GFP_KERNEL );
      |                                            ^~~~~~
/home/cmuthusamy/LATEST_CHECK/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/vsat-i2c/vsat-i2c.c:88:14: error: invalid use of u
ndefined type 'struct pca954x_platform_data'
   88 |     plat_data->modes = modes;
      |              ^~

I can see that the kernel module "i2c-mux-pca954x.ko" got compiled as below. But still facing this compilation error.

$ find build_dir/target-x86_64_glibc/linux-x86_64/ -iname "*i2c-mux-pca954x*"
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/i2c-mux-pca954x.c
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/i2c-mux-pca954x.o
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/.i2c-mux-pca954x.o.cmd
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/i2c-mux-pca954x.mod
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/.i2c-mux-pca954x.mod.cmd
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/i2c-mux-pca954x.mod.c
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/i2c-mux-pca954x.mod.o
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/.i2c-mux-pca954x.mod.o.cmd
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/i2c-mux-pca954x.ko
build_dir/target-x86_64_glibc/linux-x86_64/linux-5.15.137/drivers/i2c/muxes/.i2c-mux-pca954x.ko.cmd
build_dir/target-x86_64_glibc/linux-x86_64/packages/.pkgdir/kmod-i2c-mux-pca954x
build_dir/target-x86_64_glibc/linux-x86_64/packages/.pkgdir/kmod-i2c-mux-pca954x/lib/modules/5.15.137/i2c-mux-pca954x.ko

Some one please suggest on this issue.

Thanks,
Chinna

The error message suggests a problem in your private code. If it was written for an earlier kernel version, chances are that some kernel change requires subsequent changes on your end.
Since you didn't post v2sat-i2c.c, we can't help.

Thanks @andyboeh We have our customized i2c driver code in Linux kernel 3.10.0 and we are trying to port the same to Linux 5.15.137. Will it have too many differences in porting to the new kernel ? If so where can I get the latest driver code for Linux kernel 5.15.137 ?

I don't know your code, only you can answer this.

Seriously? kernel.org