All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/3] drm: Sync errno values for property lookup errors
Date: Mon, 21 Jan 2019 22:24:29 +0200	[thread overview]
Message-ID: <20190121202430.30789-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190121202430.30789-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use ENOENT consistently for the case where the requested property
isn't found, and EINVAL for the case where the object has no
properties whatsoever. Currenrly these are handled differently
in the atomic and legacy codepaths.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
 drivers/gpu/drm/drm_mode_object.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 06390307e5a3..2a54f826cf65 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1330,7 +1330,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
 			DRM_DEBUG_ATOMIC("Object ID %d has no properties\n",
 					 obj_id);
 			drm_mode_object_put(obj);
-			ret = -ENOENT;
+			ret = -EINVAL;
 			goto out;
 		}
 
diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index e8dac94d576d..31730d935842 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -527,6 +527,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
 	property = drm_mode_obj_find_prop_id(arg_obj, arg->prop_id);
 	if (!property) {
 		DRM_DEBUG_KMS("Unknown property ID %d\n", arg->prop_id);
+		ret = -ENOENT;
 		goto out_unref;
 	}
 
-- 
2.19.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-01-21 20:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 20:24 [PATCH 1/3] drm: Add debug prints for the various object lookup errors Ville Syrjala
2019-01-21 20:24 ` Ville Syrjala [this message]
2019-01-22  9:39   ` [PATCH 2/3] drm: Sync errno values for property " Daniel Vetter
2019-01-25 21:01     ` Ville Syrjälä
2019-01-29  8:49       ` Daniel Vetter
2019-02-15  8:21   ` [LKP] [drm] ef3de4356d: piglit.igt.kms_atomic.atomic_invalid_params.fail kernel test robot
2019-02-15  8:21     ` kernel test robot
2019-01-21 20:24 ` [PATCH 3/3] drm: Add a debug print for drm_modeset_backoff() Ville Syrjala
2019-01-22  9:41   ` Daniel Vetter
2019-01-21 21:07 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm: Add debug prints for the various object lookup errors Patchwork
2019-01-21 23:04 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-01-22  9:38 ` [Intel-gfx] [PATCH 1/3] " Daniel Vetter
2019-01-25 20:58   ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190121202430.30789-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.