/* Updates the configuration ROM image of a host. rom_version must be the current version, otherwise it will fail with return value -1. If this host does not support config-rom-update, it will return -EINVAL. Return value 0 indicates success.  */
int hpsb_update_config_rom_image(struct hpsb_host *host)
/* Updates the configuration ROM image of a host. rom_version must be the current version, otherwise it will fail with return value -1. If this host does not support config-rom-update, it will return -EINVAL. Return value 0 indicates success.  */
int hpsb_update_config_rom_image(struct hpsb_host *host)
{
	unsigned long reset_delay;
	int next_gen = host->csr.generation + 1;
	if (!host->update_config_rom)
		return -EINVAL;
	if (next_gen > 0xf)
		next_gen = 2;
	cancel_delayed_work(&host->delayed_reset);
	if (time_before(jiffies, host->csr.gen_timestamp[next_gen] + 60 * HZ))
		reset_delay =
			(60 * HZ) + host->csr.gen_timestamp[next_gen] - jiffies;
	else
		reset_delay = HZ;
	PREPARE_DELAYED_WORK(&host->delayed_reset, delayed_reset_bus);
	schedule_delayed_work(&host->delayed_reset, reset_delay);
	return 0;
}