Building Kernel Modules Fails on 4.4.59 For GadgetFS


I am using a BeagleBone Black with the following kernel version that I build and installed from here:

After building the kernel, which resulted in the following deb files:

linux-firmware-image-4.4.59-bone17_1cross_armhf.deb linux-headers-4.4.59-bone17_1cross_armhf.deb linux-image-4.4.59-bone17_1cross_armhf.deb linux-libc-dev_1cross_armhf.deb

I installed the resulting .deb files on my BeagleBone Black by running

sudo dpkg -i *.deb

and am now running the following kernel:

Linux beaglebone 4.4.59-bone17 #1 Thu Apr 6 13:05:33 EDT 2017 armv7l GNU/Linux

I have the following Makefile that I am using to attempt to patch the GadgetFS driver as instructed here:

ccflags-y := -I$(srctree)/drivers/usb/gadget/
ccflags-y += -I$(srctree)/drivers/usb/gadget/udc/
ccflags-y += -I$(srctree)/drivers/usb/gadget/function/