提交 92227b8d 编写于 作者: W weiping zhang 提交者: Martin K. Petersen

scsi: scsi-sysfs: Adjust error returned for adapter reset request

If scsi_host_template->host_reset is NULL and the user requests an
adapter reset through

	echo adapter > /sys/class/scsi_host/hostx/host_reset

-EINVAL will be returned even though the "adapter" argument is perfectly
valid.

Change this so that we only return -EINVAL if the provided string is
invalid.  If the host does not implement a ->host_reset function we'll
return -EOPNOTSUPP.

[mkp: tweaked patch description]
Signed-off-by: Nweiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 085e5676
......@@ -303,6 +303,8 @@ store_host_reset(struct device *dev, struct device_attribute *attr,
if (sht->host_reset)
ret = sht->host_reset(shost, type);
else
ret = -EOPNOTSUPP;
exit_store_host_reset:
if (ret == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册