提交 36a395aa 编写于 作者: A Alexander Shishkin 提交者: Yang Yingliang

intel_th: Fix user-visible error codes

commit ce666be89a8a09c5924ff08fc32e119f974bdab6 upstream.

There are a few places in the driver that end up returning ENOTSUPP to
the user, replace those with EINVAL.
Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: ba82664c ("intel_th: Add Memory Storage Unit driver")
Cc: stable@vger.kernel.org # v4.4+
Link: https://lore.kernel.org/r/20200317062215.15598-6-alexander.shishkin@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 22eb49b2
...@@ -491,7 +491,7 @@ static int msc_configure(struct msc *msc) ...@@ -491,7 +491,7 @@ static int msc_configure(struct msc *msc)
lockdep_assert_held(&msc->buf_mutex); lockdep_assert_held(&msc->buf_mutex);
if (msc->mode > MSC_MODE_MULTI) if (msc->mode > MSC_MODE_MULTI)
return -ENOTSUPP; return -EINVAL;
if (msc->mode == MSC_MODE_MULTI) if (msc->mode == MSC_MODE_MULTI)
msc_buffer_clear_hw_header(msc); msc_buffer_clear_hw_header(msc);
...@@ -942,7 +942,7 @@ static int msc_buffer_alloc(struct msc *msc, unsigned long *nr_pages, ...@@ -942,7 +942,7 @@ static int msc_buffer_alloc(struct msc *msc, unsigned long *nr_pages,
} else if (msc->mode == MSC_MODE_MULTI) { } else if (msc->mode == MSC_MODE_MULTI) {
ret = msc_buffer_multi_alloc(msc, nr_pages, nr_wins); ret = msc_buffer_multi_alloc(msc, nr_pages, nr_wins);
} else { } else {
ret = -ENOTSUPP; ret = -EINVAL;
} }
if (!ret) { if (!ret) {
...@@ -1165,7 +1165,7 @@ static ssize_t intel_th_msc_read(struct file *file, char __user *buf, ...@@ -1165,7 +1165,7 @@ static ssize_t intel_th_msc_read(struct file *file, char __user *buf,
if (ret >= 0) if (ret >= 0)
*ppos = iter->offset; *ppos = iter->offset;
} else { } else {
ret = -ENOTSUPP; ret = -EINVAL;
} }
put_count: put_count:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册