[Samsung Galaxy Nexus] wyur:
Compiling issues (from cm-12.1 source)

Hi [MENTION=2633638]Ziyan[/MENTION]

First of all, thank you for what you do, really.

Recently I ventured in custom Cyanogenmod ROM compiling, specifically for Maguro. Put in short, I tried to compile the sources twice, once on 28/02/16 and once on 07/03/16, but I continuously get a couple of errors.

First is a missing header that prevents the compilation, here's part of the logs:

/home/power/android/system/kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_xmm6260.c: In function 'xmm6260_init_modemctl_device':
/home/power/android/system/kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_xmm6260.c:195:2: error: implicit declaration of function 'to_platform_device' [-Werror=implicit-function-declaration]
pdev = to_platform_device(mc->dev);
^
/home/power/android/system/kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_xmm6260.c:195:7: warning: assignment makes pointer from integer without a cast [enabled by default]
pdev = to_platform_device(mc->dev);
^
/home/power/android/system/kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_xmm6260.c:196:2: error: implicit declaration of function 'platform_get_irq' [-Werror=implicit-function-declaration]
mc->irq_phone_active = platform_get_irq(pdev, 0);
^
cc1: some warnings being treated as errors

The solution is to add #include <linux/platform_device.h> inside these files:

.../kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_xmm6260.c
.../kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_cbp7.1.c
.../kernel/samsung/tuna/drivers/misc/modem_if/modem_link_device_dpram.c
.../kernel/samsung/tuna/drivers/misc/modem_if/modem_modemctl_device_cmc221.c
.../kernel/samsung/tuna/drivers/misc/modem_if/modem_link_device_usb.c

The second error, the one I can't seem to get around with, is related to USB (after selecting some USB drivers):

In file included from /home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hcd.c:125:0:
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-dbg.c: In function 'print_async_list':
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-dbg.c:603:2: error: implicit declaration of function 'omap_readl' [-Werror=implicit-function-declaration]
printk("HCCAPBASE : %08x\n", omap_readl(0x4A064C00));
^
In file included from /home/power/android/system/kernel/samsung/tuna/include/linux/cache.h:4:0,
from /home/power/android/system/kernel/samsung/tuna/include/linux/time.h:7,
from /home/power/android/system/kernel/samsung/tuna/include/linux/stat.h:60,
from /home/power/android/system/kernel/samsung/tuna/include/linux/module.h:10,
from /home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hcd.c:23:
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-dbg.c: In function 'debug_lpm_write':
/home/power/android/system/kernel/samsung/tuna/include/linux/kernel.h:538:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
(void) (&_min1 == &_min2); \
^
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-dbg.c:1062:8: note: in expansion of macro 'min'
len = min(count, sizeof(buf) - 1);
^
In file included from /home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hcd.c:336:0:
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hub.c: In function 'uhh_omap_reset_link':
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hub.c:768:2: error: implicit declaration of function 'omap_writel' [-Werror=implicit-function-declaration]
omap_writel(temp_reg, L3INIT_HSUSBHOST_CLKCTRL);
^
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hub.c:829:3: error: implicit declaration of function 'omap_readw' [-Werror=implicit-function-declaration]
orig_val = val = omap_readw(0x4A1000C4);
^
/home/power/android/system/kernel/samsung/tuna/drivers/usb/host/ehci-hub.c:831:3: error: implicit declaration of function 'omap_writew' [-Werror=implicit-function-declaration]
omap_writew(val, 0x4A1000C4);
^

I'm telling you because I assume you are the maintainer? If not, please point me where I can report these issues. I also saw some people reported USB issues, not sure if this is related.

Thank you.