A WARN_ON() returns a 0 or 1, not the original negative errno. Just drop
the WARN_ON() as the FD open will pass the return code to userspace and
there's only one possible source of the error (drm_sched_entity_init()).

Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Cc: [email protected]
Signed-off-by: Rob Herring (Arm) <[email protected]>
---
 drivers/accel/ethosu/ethosu_job.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/accel/ethosu/ethosu_job.c 
b/drivers/accel/ethosu/ethosu_job.c
index 6a038c0384cc..99c8812691e5 100644
--- a/drivers/accel/ethosu/ethosu_job.c
+++ b/drivers/accel/ethosu/ethosu_job.c
@@ -368,12 +368,10 @@ int ethosu_job_open(struct ethosu_file_priv *ethosu_priv)
 {
        struct ethosu_device *dev = ethosu_priv->edev;
        struct drm_gpu_scheduler *sched = &dev->sched;
-       int ret;
 
-       ret = drm_sched_entity_init(&ethosu_priv->sched_entity,
-                                   DRM_SCHED_PRIORITY_NORMAL,
-                                   &sched, 1, NULL);
-       return WARN_ON(ret);
+       return drm_sched_entity_init(&ethosu_priv->sched_entity,
+                                    DRM_SCHED_PRIORITY_NORMAL,
+                                    &sched, 1, NULL);
 }
 
 void ethosu_job_close(struct ethosu_file_priv *ethosu_priv)

-- 
2.53.0

Reply via email to