/* Return value: count on success / other on failure  */
static ssize_t ipr_store_reset_adapter(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
/* Return value: count on success / other on failure  */
static ssize_t ipr_store_reset_adapter(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
	struct Scsi_Host *shost = class_to_shost(dev);
	struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
	unsigned long lock_flags;
	int result = count;
	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;
	spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
	if (!ioa_cfg->in_reset_reload)
		ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
	wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
	return result;
}