Problem width linux driver for fxos8700/fxas2100x

Hey.I connected FXAS21002C and FXOS8700CQ to my system via spi and i2c. Devices normally work if they are accessed directly. Now I wanted to add the drivers of these devices to the kernel, but when I compile, I get a bunch of errors. What can be wrong?