Re: [PATCH 4/5] powerpc/zImage: Rework serial driver probing
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-03-20 09:20:50
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-03-20 09:20:50
Oliver O'Halloran [off-list ref] writes:
Rather than checking the compatible string in serial_driver_init() we call into the driver's init function and wait for a driver to inidicate it bound to the device by returning zero. The pointers to each driver probe functions are stored in the ".serialdrv" section of the zImage, similar to how initcalls and whatnot are handled inside Linux. This structure allows us to conditionally compile specific driver files based on the KConfig settings. This is needed because we don't have access to the KConfig #defines in the zImage source files (it's a giant #include headache) so conditional compilation is the only way to eliminate unnecessary code.
Did you actually get the config.h include working? Or was it such a big headache that it doesn't even work? I'm pretty happy with this patch regardless, but it would be simpler and less bug prone if the CONFIG_ symbols were usable in the boot code. cheers