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);
114 part->base = virt_base;
116 part->base = sram->virt_base + block->start;
120 ret = sram_add_pool(sram, block, start, part);
125 ret = sram_add_export(sram, block, start, part);
130 ret = sram_check_protect_exec(sram, block, part);
134 ret = sram_add_pool(sram, block, start, part);
138 sram_add_protect_exec(part);
148 struct sram_partition *part;
153 part = &sram->partition[sram->partitions - 1];
154 for (; sram->partitions; sram->partitions--, part--) {
155 if (part->battr.size)
156 device_remove_bin_file(sram->dev, &part->battr);
158 if (part->pool &&
159 gen_pool_avail(part->pool) < gen_pool_size(part->pool))