Lines Matching defs:unit
111 * @directory: e.g. root directory or unit directory
146 static void get_modalias_ids(struct fw_unit *unit, int *id)
148 get_ids(&fw_parent_device(unit)->config_rom[5], id);
149 get_ids(unit->directory, id);
189 static int get_modalias(struct fw_unit *unit, char *buffer, size_t buffer_size)
193 get_modalias_ids(unit, id);
202 struct fw_unit *unit = fw_unit(dev);
205 get_modalias(unit, modalias, sizeof(modalias));
349 struct fw_unit *unit = fw_unit(dev);
352 length = get_modalias(unit, buf, PAGE_SIZE);
362 struct fw_unit *unit = fw_unit(dev);
365 (int)(unit->directory - device->config_rom));
637 struct fw_unit *unit = fw_unit(dev);
639 kfree(unit);
655 struct fw_unit *unit;
665 * Get the address of the unit directory and try to
668 unit = kzalloc(sizeof(*unit), GFP_KERNEL);
669 if (unit == NULL) {
670 fw_error("failed to allocate memory for unit\n");
674 unit->directory = ci.p + value - 1;
675 unit->device.bus = &fw_bus_type;
676 unit->device.type = &fw_unit_type;
677 unit->device.parent = &device->device;
678 dev_set_name(&unit->device, "%s.%d", dev_name(&device->device), i++);
680 BUILD_BUG_ON(ARRAY_SIZE(unit->attribute_group.attrs) <
683 init_fw_attribute_group(&unit->device,
685 &unit->attribute_group);
687 if (device_register(&unit->device) < 0)
693 kfree(unit);
804 struct fw_unit *unit = fw_unit(dev);
809 driver->update(unit);