+static int
+calculate_bus_addr(u8 start_bus, off_t start_addr, u32 total_length, u8 bus, off_t *addr, u32 *length)
+{
+ u32 offset;
+
+ offset = 32*8*4096 * (bus - start_bus);
+ if (offset >= total_length)
+ return 0;
+
+ *addr = start_addr + offset;
+ *length = total_length - offset;
+
+ if (*length > 32*8*4096)
+ *length = 32*8*4096;
+
+ return 1;
+}
+