Commit ce666be8 authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman

intel_th: Fix user-visible error codes

There are a few places in the driver that end up returning ENOTSUPP to
the user, replace those with EINVAL.
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: default avatarAndy 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 885f1235
...@@ -761,7 +761,7 @@ static int msc_configure(struct msc *msc) ...@@ -761,7 +761,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) {
if (msc_win_set_lockout(msc->cur_win, WIN_READY, WIN_INUSE)) if (msc_win_set_lockout(msc->cur_win, WIN_READY, WIN_INUSE))
...@@ -1295,7 +1295,7 @@ static int msc_buffer_alloc(struct msc *msc, unsigned long *nr_pages, ...@@ -1295,7 +1295,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) {
...@@ -1531,7 +1531,7 @@ static ssize_t intel_th_msc_read(struct file *file, char __user *buf, ...@@ -1531,7 +1531,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment