board: tbs2910: Convert i2c and rtc to driver model
[oweals/u-boot.git] / scripts / basic / fixdep.c
index e8e8c7756deb09e00ec7cb48e3dd0ad628e3c6cc..da7fb2cd4dde9cd1ca52e8981628fdb9e3ad05f7 100644 (file)
@@ -249,10 +249,17 @@ static void parse_config_file(const char *map, size_t len)
                if (q - p < 0)
                        continue;
 
-               /* U-Boot also handles CONFIG_IS_{ENABLED/BUILTIN/MODULE} */
+               /*
+                * U-Boot also handles
+                *   CONFIG_IS_ENABLED(...)
+                *   CONFIG_IS_BUILTIN(...)
+                *   CONFIG_IS_MODULE(...)
+                *   CONFIG_VAL(...)
+                */
                if ((q - p == 10 && !memcmp(p, "IS_ENABLED(", 11)) ||
                    (q - p == 10 && !memcmp(p, "IS_BUILTIN(", 11)) ||
-                   (q - p == 9 && !memcmp(p, "IS_MODULE(", 10))) {
+                   (q - p == 9 && !memcmp(p, "IS_MODULE(", 10)) ||
+                   (q - p == 3 && !memcmp(p, "VAL(", 4))) {
                        p = q + 1;
                        for (q = p; q < map + len; q++)
                                if (*q == ')')
@@ -296,7 +303,11 @@ static void do_config_file(const char *filename)
                perror(filename);
                exit(2);
        }
-       fstat(fd, &st);
+       if (fstat(fd, &st) < 0) {
+               fprintf(stderr, "fixdep: error fstat'ing config file: ");
+               perror(filename);
+               exit(2);
+       }
        if (st.st_size == 0) {
                close(fd);
                return;