Searched refs:battr (Results 1 - 2 of 2) sorted by relevance

/linux-4.4.14/fs/sysfs/
H A Dfile.c85 struct bin_attribute *battr = of->kn->priv; sysfs_kf_bin_read() local
99 if (!battr->read) sysfs_kf_bin_read()
102 return battr->read(of->file, kobj, battr, buf, pos, count); sysfs_kf_bin_read()
140 struct bin_attribute *battr = of->kn->priv; sysfs_kf_bin_write() local
152 if (!battr->write) sysfs_kf_bin_write()
155 return battr->write(of->file, kobj, battr, buf, pos, count); sysfs_kf_bin_write()
161 struct bin_attribute *battr = of->kn->priv; sysfs_kf_bin_mmap() local
164 return battr->mmap(of->file, kobj, battr, vma); sysfs_kf_bin_mmap()
279 struct bin_attribute *battr = (void *)attr; sysfs_add_file_mode_ns() local
281 if (battr->mmap) sysfs_add_file_mode_ns()
283 else if (battr->read && battr->write) sysfs_add_file_mode_ns()
285 else if (battr->read) sysfs_add_file_mode_ns()
287 else if (battr->write) sysfs_add_file_mode_ns()
292 size = battr->size; sysfs_add_file_mode_ns()
/linux-4.4.14/drivers/misc/
H A Dsram.c35 struct bin_attribute battr; member in struct:sram_partition
65 part = container_of(attr, struct sram_partition, battr); sram_read()
80 part = container_of(attr, struct sram_partition, battr); sram_write()
112 sysfs_bin_attr_init(&part->battr); sram_add_export()
113 part->battr.attr.name = devm_kasprintf(sram->dev, GFP_KERNEL, sram_add_export()
116 if (!part->battr.attr.name) sram_add_export()
119 part->battr.attr.mode = S_IRUSR | S_IWUSR; sram_add_export()
120 part->battr.read = sram_read; sram_add_export()
121 part->battr.write = sram_write; sram_add_export()
122 part->battr.size = block->size; sram_add_export()
124 return device_create_bin_file(sram->dev, &part->battr); sram_add_export()
160 if (part->battr.size) sram_free_partitions()
161 device_remove_bin_file(sram->dev, &part->battr); sram_free_partitions()

Completed in 59 milliseconds