if (!ctx)
return -ENODEV;
+ if (!priv->gpu)
+ return -ENODEV;
+
+ if (prio >= priv->gpu->nr_rings)
+ return -EINVAL;
+
queue = kzalloc(sizeof(*queue), GFP_KERNEL);
if (!queue)
kref_init(&queue->ref);
queue->flags = flags;
-
- if (priv->gpu) {
- if (prio >= priv->gpu->nr_rings) {
- kfree(queue);
- return -EINVAL;
- }
-
- queue->prio = prio;
- }
+ queue->prio = prio;
write_lock(&ctx->queuelock);
struct msm_drm_private *priv = drm->dev_private;
int default_prio;
+ if (!priv->gpu)
+ return -ENODEV;
+
/*
* Select priority 2 as the "default priority" unless nr_rings is less
* than 2 and then pick the lowest priority
*/
- default_prio = priv->gpu ?
- clamp_t(uint32_t, 2, 0, priv->gpu->nr_rings - 1) : 0;
+ default_prio = clamp_t(uint32_t, 2, 0, priv->gpu->nr_rings - 1);
INIT_LIST_HEAD(&ctx->submitqueues);