sammyizimmy / ili9341

Raspberry Pi 8 bit parallel ili9341 lcd driver
38 stars 19 forks source link

Incompatible-pointer-types when make #5

Open twlawrenceko opened 3 years ago

twlawrenceko commented 3 years ago

Hello,

I am getting compiling error when make:

make -C /lib/modules/5.4.83-v7l+/build M=/home/pi/ILI9341-screen/ili9341 modules
make[1]: Entering directory '/home/pi/linux-76c49e60e742d0bebd798be972d67dd3fd007691'
  CC [M]  /home/pi/ILI9341-screen/ili9341/ili9341.o
/home/pi/ILI9341-screen/ili9341/ili9341.c:488:23: error: initialization of 'ssize_t (*)(struct fb_info *, char *, size_t,  loff_t *)' {aka 'int (*)(struct fb_info *, char *, unsigned int,  long long int *)'} from incompatible pointer type ssize_t (*)(struct fb_info *, const char *, size_t,  loff_t *)' {aka 'int (*)(struct fb_info *, const char *, unsigned int,  long long int *)'} [-Werror=incompatible-pointer-types]
     .fb_read        = ili9341_read,
                       ^~~~~~~~~~~~
/home/pi/ILI9341-screen/ili9341/ili9341.c:488:23: note: (near initialization for 'ili9341_ops.fb_read')
/home/pi/ILI9341-screen/ili9341/ili9341.c:268:13: warning: 'ili9341_update_display_color_area' defined but not used [-Wunused-function]
 static void ili9341_update_display_color_area(const struct fb_fillrect *rect)
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/ILI9341-screen/ili9341/ili9341.c:225:13: warning: 'ili9341_update_display_area' defined but not used [-Wunused-function]
 static void ili9341_update_display_area(const struct fb_image *image)
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:266: /home/pi/ILI9341-screen/ili9341/ili9341.o] Error 1
make[1]: *** [Makefile:1732: /home/pi/ILI9341-screen/ili9341] Error 2
make[1]: Leaving directory '/home/pi/linux-76c49e60e742d0bebd798be972d67dd3fd007691'
make: *** [Makefile:4: all] Error 2

Any ideas how to solve this?

Thanks

sammyizimmy commented 3 years ago

Howdy, I've made a change that fixes the error on my test machine. I got rid of the "const" modifier in the ili9341_read function declaration.

from: static ssize_t ili9341_read(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos) to: static ssize_t ili9341_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos)

Go ahead and give it another try.

Thanks.