Commit 519f4ed0 authored by Oded Gabbay's avatar Oded Gabbay

habanalabs: replace some -ENOTTY with -EINVAL

-ENOTTY is returned in case of error in the ioctl arguments themselves,
such as function that doesn't exists.

In all other cases, where the error is in the arguments of the custom
data structures that we define that are passed in the various ioctls,
we need to return -EINVAL.
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 0a63ac76
...@@ -475,7 +475,7 @@ int hl_cb_ioctl(struct hl_fpriv *hpriv, void *data) ...@@ -475,7 +475,7 @@ int hl_cb_ioctl(struct hl_fpriv *hpriv, void *data)
break; break;
default: default:
rc = -ENOTTY; rc = -EINVAL;
break; break;
} }
......
...@@ -693,7 +693,7 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, ...@@ -693,7 +693,7 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data,
default: default:
dev_err(dev, "Invalid request %d\n", args->op); dev_err(dev, "Invalid request %d\n", args->op);
rc = -ENOTTY; rc = -EINVAL;
break; break;
} }
...@@ -748,7 +748,7 @@ static int hl_debug_ioctl(struct hl_fpriv *hpriv, void *data) ...@@ -748,7 +748,7 @@ static int hl_debug_ioctl(struct hl_fpriv *hpriv, void *data)
default: default:
dev_err(hdev->dev, "Invalid request %d\n", args->op); dev_err(hdev->dev, "Invalid request %d\n", args->op);
rc = -ENOTTY; rc = -EINVAL;
break; break;
} }
......
...@@ -2031,7 +2031,7 @@ static int mem_ioctl_no_mmu(struct hl_fpriv *hpriv, union hl_mem_args *args) ...@@ -2031,7 +2031,7 @@ static int mem_ioctl_no_mmu(struct hl_fpriv *hpriv, union hl_mem_args *args)
default: default:
dev_err(hdev->dev, "Unknown opcode for memory IOCTL\n"); dev_err(hdev->dev, "Unknown opcode for memory IOCTL\n");
rc = -ENOTTY; rc = -EINVAL;
break; break;
} }
...@@ -2156,7 +2156,7 @@ int hl_mem_ioctl(struct hl_fpriv *hpriv, void *data) ...@@ -2156,7 +2156,7 @@ int hl_mem_ioctl(struct hl_fpriv *hpriv, void *data)
default: default:
dev_err(hdev->dev, "Unknown opcode for memory IOCTL\n"); dev_err(hdev->dev, "Unknown opcode for memory IOCTL\n");
rc = -ENOTTY; rc = -EINVAL;
break; break;
} }
......
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