Lines Matching refs:part
29 struct sram_partition *part;
31 part = container_of(attr, struct sram_partition, battr);
33 mutex_lock(&part->lock);
34 memcpy_fromio(buf, part->base + pos, count);
35 mutex_unlock(&part->lock);
44 struct sram_partition *part;
46 part = container_of(attr, struct sram_partition, battr);
48 mutex_lock(&part->lock);
49 memcpy_toio(part->base + pos, buf, count);
50 mutex_unlock(&part->lock);
56 phys_addr_t start, struct sram_partition *part)
60 part->pool = devm_gen_pool_create(sram->dev, ilog2(SRAM_GRANULARITY),
62 if (IS_ERR(part->pool))
63 return PTR_ERR(part->pool);
65 ret = gen_pool_add_virt(part->pool, (unsigned long)part->base, start,
76 phys_addr_t start, struct sram_partition *part)
78 sysfs_bin_attr_init(&part->battr);
79 part->battr.attr.name = devm_kasprintf(sram->dev, GFP_KERNEL,
82 if (!part->battr.attr.name)
85 part->battr.attr.mode = S_IRUSR | S_IWUSR;
86 part->battr.read = sram_read;
87 part->battr.write = sram_write;
88 part->battr.size = block->size;
90 return device_create_bin_file(sram->dev, &part->battr);
97 struct sram_partition *part = &sram->partition[sram->partitions];
99 mutex_init(&part->lock);
100 part->base = sram->virt_base + block->start;
103 ret = sram_add_pool(sram, block, start, part);
108 ret = sram_add_export(sram, block, start, part);
113 ret = sram_check_protect_exec(sram, block, part);
117 ret = sram_add_pool(sram, block, start, part);
121 sram_add_protect_exec(part);
131 struct sram_partition *part;
136 part = &sram->partition[sram->partitions - 1];
137 for (; sram->partitions; sram->partitions--, part--) {
138 if (part->battr.size)
139 device_remove_bin_file(sram->dev, &part->battr);
141 if (part->pool &&
142 gen_pool_avail(part->pool) < gen_pool_size(part->pool))