fatal error: dt-bindings/gpio/gpio.h: No such file or directory
 #include <dt-bindings/gpio/gpio.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~


新版本内核,检查下面目录中的链接文件是否正常,不正常删掉后git reset --hard

$ ls -alh scripts/dtc/include-prefixes
total 8.0K
drwxrwxr-x 2 bob bob 4.0K 9月  24 18:53 .
drwxrwxr-x 4 bob bob 4.0K 9月  24 18:47 ..
lrwxrwxrwx 1 bob bob   26 9月  24 18:53 arc -> ../../../arch/arc/boot/dts
lrwxrwxrwx 1 bob bob   26 9月  24 18:53 arm -> ../../../arch/arm/boot/dts
lrwxrwxrwx 1 bob bob   28 9月  24 18:53 arm64 -> ../../../arch/arm64/boot/dts
lrwxrwxrwx 1 bob bob   26 9月  24 18:53 c6x -> ../../../arch/c6x/boot/dts
lrwxrwxrwx 1 bob bob   27 9月  24 18:53 cris -> ../../../arch/cris/boot/dts
lrwxrwxrwx 1 bob bob   28 9月  24 18:53 dt-bindings -> ../../../include/dt-bindings
lrwxrwxrwx 1 bob bob   28 9月  24 18:53 h8300 -> ../../../arch/h8300/boot/dts
lrwxrwxrwx 1 bob bob   28 9月  24 18:53 metag -> ../../../arch/metag/boot/dts
lrwxrwxrwx 1 bob bob   33 9月  24 18:53 microblaze -> ../../../arch/microblaze/boot/dts
lrwxrwxrwx 1 bob bob   27 9月  24 18:53 mips -> ../../../arch/mips/boot/dts
lrwxrwxrwx 1 bob bob   28 9月  24 18:53 nios2 -> ../../../arch/nios2/boot/dts
lrwxrwxrwx 1 bob bob   31 9月  24 18:53 openrisc -> ../../../arch/openrisc/boot/dts
lrwxrwxrwx 1 bob bob   30 9月  24 18:53 powerpc -> ../../../arch/powerpc/boot/dts
lrwxrwxrwx 1 bob bob   25 9月  24 18:53 sh -> ../../../arch/sh/boot/dts
lrwxrwxrwx 1 bob bob   29 9月  24 18:53 xtensa -> ../../../arch/xtensa/boot/dts


旧版本内核,同上,只是文件位置不同。

$ ls ~/kernel/linux-mainline/arch/arm/boot/dts/include/ -l
total 0
lrwxrwxrwx 1 nzhang nzhang 34 10月 19  2018 dt-bindings -> ../../../../../include/dt-bindings