Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30209 )
Change subject: soc/intel/common/block/lpc: create LPC_GET_DEV macro ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/30209/2/src/soc/intel/common/block/... File src/soc/intel/common/block/lpc/lpc_lib.c:
https://review.coreboot.org/c/coreboot/+/30209/2/src/soc/intel/common/block/... PS2, Line 29: #if !defined(__SIMPLE_DEVICE__) : #include <device/device.h> : #define LPC_GET_DEV pcidev_on_root(PCH_DEV_SLOT_LPC, 0x0) : #else : #define LPC_GET_DEV PCH_DEV_LPC : #endif
Compiles fine as by Aamir's suggestion, btw.
yes compilation will work as long as #define __SIMPLE_DEVICE__ is there.
But i don't know why we have this guard at first place and want to compile this entire file as part of simple device. is that saving anything ? general query.
That you had to get rid of the declaration in line 179, doesn't mean we need yet another macro.
I believe this new macro help it to compile as per need, i mean till romstage as simple device else regularly. unlike entire file is compile as simple device (again i don't know the goodness or bad about this) also another reason to pick this is p2sb.c is also has same problem where we have redundant function name which can be avoided. infact looking at old southbridge code that arthur has written has same implementation. Also in some AMD latest common code.