Lines Matching refs:sect_attrs
1524 static void free_sect_attrs(struct module_sect_attrs *sect_attrs) in free_sect_attrs() argument
1528 for (section = 0; section < sect_attrs->nsections; section++) in free_sect_attrs()
1529 kfree(sect_attrs->attrs[section].battr.attr.name); in free_sect_attrs()
1530 kfree(sect_attrs); in free_sect_attrs()
1536 struct module_sect_attrs *sect_attrs; in add_sect_attrs() local
1544 size[0] = ALIGN(struct_size(sect_attrs, attrs, nloaded), in add_sect_attrs()
1545 sizeof(sect_attrs->grp.bin_attrs[0])); in add_sect_attrs()
1546 size[1] = (nloaded + 1) * sizeof(sect_attrs->grp.bin_attrs[0]); in add_sect_attrs()
1547 sect_attrs = kzalloc(size[0] + size[1], GFP_KERNEL); in add_sect_attrs()
1548 if (sect_attrs == NULL) in add_sect_attrs()
1552 sect_attrs->grp.name = "sections"; in add_sect_attrs()
1553 sect_attrs->grp.bin_attrs = (void *)sect_attrs + size[0]; in add_sect_attrs()
1555 sect_attrs->nsections = 0; in add_sect_attrs()
1556 sattr = §_attrs->attrs[0]; in add_sect_attrs()
1557 gattr = §_attrs->grp.bin_attrs[0]; in add_sect_attrs()
1568 sect_attrs->nsections++; in add_sect_attrs()
1576 if (sysfs_create_group(&mod->mkobj.kobj, §_attrs->grp)) in add_sect_attrs()
1579 mod->sect_attrs = sect_attrs; in add_sect_attrs()
1582 free_sect_attrs(sect_attrs); in add_sect_attrs()
1587 if (mod->sect_attrs) { in remove_sect_attrs()
1589 &mod->sect_attrs->grp); in remove_sect_attrs()
1594 free_sect_attrs(mod->sect_attrs); in remove_sect_attrs()
1595 mod->sect_attrs = NULL; in remove_sect_attrs()
1639 if (!mod->sect_attrs) in add_notes_attrs()
1664 nattr->attr.name = mod->sect_attrs->attrs[loaded].battr.attr.name; in add_notes_attrs()