#include "core.h"
+#define ROOT_DIR_OFFSET 5
+
void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p)
{
ci->p = p + 1;
static void get_modalias_ids(const struct fw_unit *unit, int *id)
{
- get_ids(&fw_parent_device(unit)->config_rom[5], id);
+ get_ids(&fw_parent_device(unit)->config_rom[ROOT_DIR_OFFSET], id);
get_ids(unit->directory, id);
}
if (is_fw_unit(dev))
dir = fw_unit(dev)->directory;
else
- dir = fw_device(dev)->config_rom + 5;
+ dir = fw_device(dev)->config_rom + ROOT_DIR_OFFSET;
fw_csr_iterator_init(&ci, dir);
while (fw_csr_iterator_next(&ci, &key, &value))
if (is_fw_unit(dev))
dir = fw_unit(dev)->directory;
else
- dir = fw_device(dev)->config_rom + 5;
+ dir = fw_device(dev)->config_rom + ROOT_DIR_OFFSET;
if (buf) {
bufsize = PAGE_SIZE - 1;
int key, value, i = 0;
down_read(&fw_device_rwsem);
- fw_csr_iterator_init(&ci, &device->config_rom[5]);
+ fw_csr_iterator_init(&ci, &device->config_rom[ROOT_DIR_OFFSET]);
while (fw_csr_iterator_next(&ci, &key, &value)) {
if (key != (CSR_UNIT | CSR_DIRECTORY))
continue;
int key, value, i;
i = 0;
- fw_csr_iterator_init(&ci, &device->config_rom[5]);
+ fw_csr_iterator_init(&ci, &device->config_rom[ROOT_DIR_OFFSET]);
while (fw_csr_iterator_next(&ci, &key, &value)) {
if (key != (CSR_UNIT | CSR_DIRECTORY))
continue;