Lines Matching defs:unit
98 * @directory: e.g. root directory or unit directory
135 static void get_modalias_ids(const struct fw_unit *unit, int *id)
137 get_ids(&fw_parent_device(unit)->config_rom[5], id);
138 get_ids(unit->directory, id);
197 static int get_modalias(const struct fw_unit *unit, char *buffer, size_t buffer_size)
201 get_modalias_ids(unit, id);
210 const struct fw_unit *unit = fw_unit(dev);
213 get_modalias(unit, modalias, sizeof(modalias));
359 struct fw_unit *unit = fw_unit(dev);
362 length = get_modalias(unit, buf, PAGE_SIZE);
372 struct fw_unit *unit = fw_unit(dev);
374 return sysfs_emit(buf, "%td\n", unit->directory - device->config_rom);
670 struct fw_unit *unit = fw_unit(dev);
672 fw_device_put(fw_parent_device(unit));
673 kfree(unit);
689 struct fw_unit *unit;
699 * Get the address of the unit directory and try to
702 unit = kzalloc(sizeof(*unit), GFP_KERNEL);
703 if (unit == NULL)
706 unit->directory = ci.p + value - 1;
707 unit->device.bus = &fw_bus_type;
708 unit->device.type = &fw_unit_type;
709 unit->device.parent = &device->device;
710 dev_set_name(&unit->device, "%s.%d", dev_name(&device->device), i++);
712 BUILD_BUG_ON(ARRAY_SIZE(unit->attribute_group.attrs) <
715 init_fw_attribute_group(&unit->device,
717 &unit->attribute_group);
720 if (device_register(&unit->device) < 0) {
721 put_device(&unit->device);
844 struct fw_unit *unit = fw_unit(dev);
849 driver->update(unit);