Merge tag 'uuid-for-4.13-2' of git://git.infradead.org/users/hch/uuid
[muen/linux.git] / drivers / thunderbolt / switch.c
index c6f41b7d38b0d6e8332acf4245835f58ff8bf3cf..e9391bbd4036023c63d8b7ec90185f56f9523ade 100644 (file)
@@ -281,9 +281,11 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
        if (active) {
                config.name = "nvm_active";
                config.reg_read = tb_switch_nvm_read;
+               config.read_only = true;
        } else {
                config.name = "nvm_non_active";
                config.reg_write = tb_switch_nvm_write;
+               config.root_only = true;
        }
 
        config.id = id;
@@ -292,7 +294,6 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
        config.size = size;
        config.dev = &sw->dev;
        config.owner = THIS_MODULE;
-       config.root_only = true;
        config.priv = sw;
 
        return nvmem_register(&config);