Merge tag 'spi-fix-v6-6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
[platform/kernel/linux-rpi.git] / scripts / mod / file2alias.c
index 28da34b..7056751 100644 (file)
@@ -1458,8 +1458,23 @@ static int do_cdx_entry(const char *filename, void *symval,
 {
        DEF_FIELD(symval, cdx_device_id, vendor);
        DEF_FIELD(symval, cdx_device_id, device);
+       DEF_FIELD(symval, cdx_device_id, override_only);
 
-       sprintf(alias, "cdx:v%08Xd%08Xd", vendor, device);
+       switch (override_only) {
+       case 0:
+               strcpy(alias, "cdx:");
+               break;
+       case CDX_ID_F_VFIO_DRIVER_OVERRIDE:
+               strcpy(alias, "vfio_cdx:");
+               break;
+       default:
+               warn("Unknown CDX driver_override alias %08X\n",
+                    override_only);
+               return 0;
+       }
+
+       ADD(alias, "v", vendor != CDX_ANY_ID, vendor);
+       ADD(alias, "d", device != CDX_ANY_ID, device);
        return 1;
 }
 
@@ -1589,7 +1604,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
        /* First handle the "special" cases */
        if (sym_is(name, namelen, "usb"))
                do_usb_table(symval, sym->st_size, mod);
-       if (sym_is(name, namelen, "of"))
+       else if (sym_is(name, namelen, "of"))
                do_of_table(symval, sym->st_size, mod);
        else if (sym_is(name, namelen, "pnp"))
                do_pnp_device_entry(symval, sym->st_size, mod);