From patchwork Mon Jan 9 13:00:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2143726wrt; Mon, 9 Jan 2023 05:06:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxl7QyUoozucXtF94h8wTvQ8i+iJbhcZKqne7QkL1N0F/kkO2hXTME3RBHe6ZWv6pFYAUi X-Received: by 2002:a17:907:8b17:b0:7c1:8ba6:6eaf with SMTP id sz23-20020a1709078b1700b007c18ba66eafmr58394967ejc.5.1673269575625; Mon, 09 Jan 2023 05:06:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673269575; cv=pass; d=google.com; s=arc-20160816; b=lt/gsjhR90gfrrCtoR1iIYBXol2JSs4SkY3Uy+Ma8olDTOpIz1lYVpQCiheku4ZE+k 6VLRnbTDQgUrIHfuPptEXUya6f0sCnUAoY/XsL4i22VrnGoMLfhIoiTFBPMPDF++mVtj LRz6dxDTkB/L7qJnf3AF2flV8QzCZwMrj5btX9yWQf1EELqJsIH5TD/p1+SQarmGlkd7 2uQAB9gW/rQZlwD5gqmk1cDucb98s7GVg37mouszLEnfI/gGreJ8rl77Xg7eNlHQ0wUt OOluEJFpY2VrQWIJeB7eu6RuxrTxObbQ8haPPIWqF8yXaY2bczlSvMIZmP4QXxiucMAm /g7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=119OUosozo0U9mtWLJCKg4RIyTCQ7g7wNaZd1HAHXqM=; b=BDOweg4NvrMMXJ/7ks+IbsRuhcVqoHLxr8xgySdJpm0YOAYtWz18i+a4ojBpTAStgK xxK0iHHdh+qR9WUE1vfdSkDo33HkbVBHBUT3D2sTi05Z97dMQ8KDeAAAWE6Fh0Qu1W7p DqxHzvM513Iq7fsEhDI5Q8RtTJi8weZjpm8np2Ol6lMA++kRIScDe4szgeoPRaoAHzx8 N1G0CSktUQLN/lLf6O1592UgJwcVAwIhIXz40PmaJu0jQ24ueSWM189T2mk2Dsv3Q3bf 5/YNVJUQflZYSseutK+d2ZRilRkJr8hjz+CppJ6fDME+O7US+RK0AwGgiJnNV/E1wM9N obKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=LMM1Lkzi; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a1709060dd400b007c0a88076d5si6953094eji.818.2023.01.09.05.05.52; Mon, 09 Jan 2023 05:06:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=LMM1Lkzi; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237259AbjAINDw (ORCPT + 99 others); Mon, 9 Jan 2023 08:03:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236991AbjAINCr (ORCPT ); Mon, 9 Jan 2023 08:02:47 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B8812D2D for ; Mon, 9 Jan 2023 05:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673269252; cv=none; d=zohomail.in; s=zohoarc; b=fkqiGu7rP+hCFVn3B4mqzwZlYaAEnMfZ4+LaOkwpaIjFNTWoSTjSL7TLeJeOW6USE7pwFqrDr+cn8EuJsxlXQrFmPo0mY2Cd1zQfQu/75+JQE343zJiJQAW/6Zp0Vmd+NQOnMZtKBVFBBfDrEEpGR6CgjpQm+Wy62BEryCYhVDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673269252; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=119OUosozo0U9mtWLJCKg4RIyTCQ7g7wNaZd1HAHXqM=; b=FN50uvrnJrNppixDRPEIbWm8OPooNya/0146X3t7fCc3UB4Z6ZfLGypn3zpV+uroDyvUj42U+seiK2mIjlFPEMCaEWl8RdwfAQHNY7Dy9oJsp9NbbipAfLMc9Y1SrQT5NMK+VbC3m4ABB+3osuroCpjAOZEHQX4tl7rbu0YVNNw= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673269252; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=119OUosozo0U9mtWLJCKg4RIyTCQ7g7wNaZd1HAHXqM=; b=LMM1LkziEJuGaWR4/MM0qQGieQBxoNzxhDRetictCxM9vlVwDlW4SWn5yJ60IJJ9 Bcq39pMNQaAwu65FpKlZSFx0luloyaik5woy5SUF+tls4zW5Os8bWOfA7ow5oVdQgKe +GK0AsSRk5K62zQPLl4hMLX0NGjXT97LSS0VnjYU= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673269250870782.4779380876089; Mon, 9 Jan 2023 18:30:50 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie , Sam Ravnborg Cc: dri-devel , linux-kernel Message-ID: Subject: [PATCH v6 04/10] drm: Remove usage of deprecated DRM_ERROR Date: Mon, 9 Jan 2023 18:30:29 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754550318544399744?= X-GMAIL-MSGID: =?utf-8?q?1754550318544399744?= drm_print.h says DRM_ERROR is deprecated in favor of drm_err(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_bridge.c | 8 ++++---- drivers/gpu/drm/drm_bufs.c | 8 ++++---- drivers/gpu/drm/drm_client_modeset.c | 4 ++-- drivers/gpu/drm/drm_context.c | 4 ++-- drivers/gpu/drm/drm_crtc_helper.c | 8 ++++---- drivers/gpu/drm/drm_debugfs_crc.c | 3 ++- drivers/gpu/drm/drm_drv.c | 14 +++++++------- drivers/gpu/drm/drm_flip_work.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 3 ++- drivers/gpu/drm/drm_gem.c | 2 +- drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- drivers/gpu/drm/drm_hashtab.c | 4 ++-- drivers/gpu/drm/drm_lock.c | 16 ++++++++-------- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- drivers/gpu/drm/drm_mipi_dsi.c | 12 ++++++------ drivers/gpu/drm/drm_mm.c | 8 ++++---- drivers/gpu/drm/drm_mode_config.c | 2 +- drivers/gpu/drm/drm_modes.c | 26 +++++++++++++------------- drivers/gpu/drm/drm_modeset_helper.c | 2 +- drivers/gpu/drm/drm_plane.c | 2 +- drivers/gpu/drm/drm_scatter.c | 9 +++++---- drivers/gpu/drm/drm_vm.c | 2 +- 22 files changed, 73 insertions(+), 70 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index c3d69af02e79..3d27f08db74d 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -351,11 +351,11 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, list_del(&bridge->chain_node); #ifdef CONFIG_OF - DRM_ERROR("failed to attach bridge %pOF to encoder %s: %d\n", - bridge->of_node, encoder->name, ret); + drm_err(encoder->dev, "failed to attach bridge %pOF to encoder %s: %d\n", + bridge->of_node, encoder->name, ret); #else - DRM_ERROR("failed to attach bridge to encoder %s: %d\n", - encoder->name, ret); + drm_err(encoder->dev, "failed to attach bridge to encoder %s: %d\n", + encoder->name, ret); #endif return ret; diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index fcca21e8efac..98aaf3379a3b 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -1474,15 +1474,15 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data, if (copy_from_user(&idx, &request->list[i], sizeof(idx))) return -EFAULT; if (idx < 0 || idx >= dma->buf_count) { - DRM_ERROR("Index %d (of %d max)\n", - idx, dma->buf_count - 1); + drm_err(dev, "Index %d (of %d max)\n", + idx, dma->buf_count - 1); return -EINVAL; } idx = array_index_nospec(idx, dma->buf_count); buf = dma->buflist[idx]; if (buf->file_priv != file_priv) { - DRM_ERROR("Process %d freeing buffer not owned\n", - task_pid_nr(current)); + drm_err(dev, "Process %d freeing buffer not owned\n", + task_pid_nr(current)); return -EINVAL; } drm_legacy_free_buffer(dev, buf); diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index ae19734974b5..e2403b8c6347 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -808,7 +808,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, offsets = kcalloc(connector_count, sizeof(*offsets), GFP_KERNEL); enabled = kcalloc(connector_count, sizeof(bool), GFP_KERNEL); if (!crtcs || !modes || !enabled || !offsets) { - DRM_ERROR("Memory allocation failed\n"); + drm_err(client->dev, "Memory allocation failed\n"); ret = -ENOMEM; goto out; } @@ -832,7 +832,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, offsets, enabled, width, height) && !drm_client_target_preferred(connectors, connector_count, modes, offsets, enabled, width, height)) - DRM_ERROR("Unable to find initial modes\n"); + drm_err(client->dev, "Unable to find initial modes\n"); DRM_DEBUG_KMS("picking CRTCs for %dx%d config\n", width, height); diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index c6e6a3e7219a..f6d68fad8311 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c @@ -276,7 +276,7 @@ int drm_legacy_setsareactx(struct drm_device *dev, void *data, static int drm_context_switch(struct drm_device * dev, int old, int new) { if (test_and_set_bit(0, &dev->context_flag)) { - DRM_ERROR("Reentering -- FIXME\n"); + drm_err(dev, "Reentering -- FIXME\n"); return -EBUSY; } @@ -307,7 +307,7 @@ static int drm_context_switch_complete(struct drm_device *dev, dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ if (!_DRM_LOCK_IS_HELD(file_priv->master->lock.hw_lock->lock)) { - DRM_ERROR("Lock isn't held after context switch\n"); + drm_err(dev, "Lock isn't held after context switch\n"); } /* If a context switch is ever initiated diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index a209659a996c..b74b4301a471 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -768,8 +768,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, if (!drm_crtc_helper_set_mode(set->crtc, set->mode, set->x, set->y, save_set.fb)) { - DRM_ERROR("failed to set mode on [CRTC:%d:%s]\n", - set->crtc->base.id, set->crtc->name); + drm_err(dev, "failed to set mode on [CRTC:%d:%s]\n", + set->crtc->base.id, set->crtc->name); set->crtc->primary->fb = save_set.fb; ret = -EINVAL; goto fail; @@ -826,7 +826,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, if (mode_changed && !drm_crtc_helper_set_mode(save_set.crtc, save_set.mode, save_set.x, save_set.y, save_set.fb)) - DRM_ERROR("failed to restore config after modeset failure\n"); + drm_err(dev, "failed to restore config after modeset failure\n"); kfree(save_connector_encoders); kfree(save_encoder_crtcs); @@ -996,7 +996,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev) /* Restoring the old config should never fail! */ if (ret == false) - DRM_ERROR("failed to set mode on crtc %p\n", crtc); + drm_err(dev, "failed to set mode on crtc %p\n", crtc); /* Turn off outputs that were already powered off */ if (drm_helper_choose_crtc_dpms(crtc)) { diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index bbc3bc4ba844..a59ef3f0e4a1 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -416,7 +416,8 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame, spin_unlock_irqrestore(&crc->lock, flags); if (!was_overflow) - DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n"); + drm_err(crtc->dev, + "Overflow of CRC buffer, userspace reads too slow.\n"); return -ENOBUFS; } diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index dfb73c9d7930..5802d714ad8d 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -163,7 +163,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); if (ret) { - DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); + drm_err(dev, "DRM: Failed to initialize /sys/kernel/debug/dri.\n"); goto err_debugfs; } @@ -402,7 +402,7 @@ void drm_put_dev(struct drm_device *dev) DRM_DEBUG("\n"); if (!dev) { - DRM_ERROR("cleanup called no dev\n"); + drm_err(NULL, "cleanup called no dev\n"); return; } @@ -517,7 +517,7 @@ static struct inode *drm_fs_inode_new(void) r = simple_pin_fs(&drm_fs_type, &drm_fs_mnt, &drm_fs_cnt); if (r < 0) { - DRM_ERROR("Cannot mount pseudo fs: %d\n", r); + drm_err(NULL, "Cannot mount pseudo fs: %d\n", r); return ERR_PTR(r); } @@ -587,7 +587,7 @@ static int drm_dev_init(struct drm_device *dev, int ret; if (!drm_core_init_complete) { - DRM_ERROR("DRM core is not initialized\n"); + drm_err(NULL, "DRM core is not initialized\n"); return -ENODEV; } @@ -625,7 +625,7 @@ static int drm_dev_init(struct drm_device *dev, inode = drm_fs_inode_new(); if (IS_ERR(inode)) { ret = PTR_ERR(inode); - DRM_ERROR("Cannot allocate anonymous inode: %d\n", ret); + drm_err(dev, "Cannot allocate anonymous inode: %d\n", ret); goto err; } @@ -650,7 +650,7 @@ static int drm_dev_init(struct drm_device *dev, if (drm_core_check_feature(dev, DRIVER_GEM)) { ret = drm_gem_init(dev); if (ret) { - DRM_ERROR("Cannot initialize graphics execution manager (GEM)\n"); + drm_err(dev, "Cannot initialize graphics execution manager (GEM)\n"); goto err; } } @@ -1054,7 +1054,7 @@ static int __init drm_core_init(void) ret = drm_sysfs_init(); if (ret < 0) { - DRM_ERROR("Cannot create DRM class: %d\n", ret); + drm_err(NULL, "Cannot create DRM class: %d\n", ret); goto error; } diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c index 060b753881a2..8cbf325a0414 100644 --- a/drivers/gpu/drm/drm_flip_work.c +++ b/drivers/gpu/drm/drm_flip_work.c @@ -82,7 +82,7 @@ void drm_flip_work_queue(struct drm_flip_work *work, void *val) if (task) { drm_flip_work_queue_task(work, task); } else { - DRM_ERROR("%s could not allocate task!\n", work->name); + drm_err(NULL, "%s could not allocate task!\n", work->name); work->func(work, val); } } diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index aff3746dedfb..b21071919644 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -1070,7 +1070,8 @@ static void legacy_remove_fb(struct drm_framebuffer *fb) /* should turn off the crtc */ if (drm_crtc_force_disable(crtc)) - DRM_ERROR("failed to reset crtc %p when fb was deleted\n", crtc); + drm_err(dev, "failed to reset crtc %p when fb was deleted\n", + crtc); } } diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 59a0bb5ebd85..c14bff925a12 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -101,7 +101,7 @@ drm_gem_init(struct drm_device *dev) vma_offset_manager = drmm_kzalloc(dev, sizeof(*vma_offset_manager), GFP_KERNEL); if (!vma_offset_manager) { - DRM_ERROR("out of memory\n"); + drm_err(dev, "out of memory\n"); return -ENOMEM; } diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c index 1e658c448366..1ba551b0ab97 100644 --- a/drivers/gpu/drm/drm_gem_dma_helper.c +++ b/drivers/gpu/drm/drm_gem_dma_helper.c @@ -583,7 +583,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret = dma_buf_vmap_unlocked(attach->dmabuf, &map); if (ret) { - DRM_ERROR("Failed to vmap PRIME buffer\n"); + drm_err(dev, "Failed to vmap PRIME buffer\n"); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c index 60afa1865559..a1ebf8e056c7 100644 --- a/drivers/gpu/drm/drm_hashtab.c +++ b/drivers/gpu/drm/drm_hashtab.c @@ -53,7 +53,7 @@ int drm_ht_create(struct drm_open_hash *ht, unsigned int order) else ht->table = vzalloc(array_size(size, sizeof(*ht->table))); if (!ht->table) { - DRM_ERROR("Out of memory for hash table\n"); + drm_err(NULL, "Out of memory for hash table\n"); return -ENOMEM; } return 0; @@ -157,7 +157,7 @@ int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *it } while(ret && (unshifted_key != first)); if (ret) { - DRM_ERROR("Available key bit space exhausted\n"); + drm_err(NULL, "Available key bit space exhausted\n"); return -EINVAL; } return 0; diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index 1efbd5389d89..411f75a1ee14 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c @@ -79,8 +79,8 @@ int drm_lock_take(struct drm_lock_data *lock_data, if (_DRM_LOCKING_CONTEXT(old) == context) { if (old & _DRM_LOCK_HELD) { if (context != DRM_KERNEL_CONTEXT) { - DRM_ERROR("%d holds heavyweight lock\n", - context); + drm_err(NULL, "%d holds heavyweight lock\n", + context); } return 0; } @@ -142,8 +142,8 @@ static int drm_legacy_lock_free(struct drm_lock_data *lock_data, } while (prev != old); if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { - DRM_ERROR("%d freed heavyweight lock held by %d\n", - context, _DRM_LOCKING_CONTEXT(old)); + drm_err(NULL, "%d freed heavyweight lock held by %d\n", + context, _DRM_LOCKING_CONTEXT(old)); return 1; } wake_up_interruptible(&lock_data->lock_queue); @@ -175,8 +175,8 @@ int drm_legacy_lock(struct drm_device *dev, void *data, ++file_priv->lock_count; if (lock->context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", - task_pid_nr(current), lock->context); + drm_err(dev, "Process %d using kernel context %d\n", + task_pid_nr(current), lock->context); return -EINVAL; } @@ -263,8 +263,8 @@ int drm_legacy_unlock(struct drm_device *dev, void *data, struct drm_file *file_ return -EOPNOTSUPP; if (lock->context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", - task_pid_nr(current), lock->context); + drm_err(dev, "Process %d using kernel context %d\n", + task_pid_nr(current), lock->context); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index c871d9f096b8..58ff9503a403 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -603,7 +603,7 @@ int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev, drm_mode_copy(&dbidev->mode, mode); ret = mipi_dbi_rotate_mode(&dbidev->mode, rotation); if (ret) { - DRM_ERROR("Illegal rotation value %u\n", rotation); + drm_err(drm, "Illegal rotation value %u\n", rotation); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 497ef4b6a90a..d9d70601ccb4 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -161,13 +161,13 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node) u32 reg; if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) { - drm_err(host, "modalias failure on %pOF\n", node); + drm_err(host->dev, "modalias failure on %pOF\n", node); return ERR_PTR(-EINVAL); } ret = of_property_read_u32(node, "reg", ®); if (ret) { - drm_err(host, "device node %pOF has no valid reg property: %d\n", + drm_err(host->dev, "device node %pOF has no valid reg property: %d\n", node, ret); return ERR_PTR(-EINVAL); } @@ -205,18 +205,18 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *host, int ret; if (!info) { - drm_err(host, "invalid mipi_dsi_device_info pointer\n"); + drm_err(host->dev, "invalid mipi_dsi_device_info pointer\n"); return ERR_PTR(-EINVAL); } if (info->channel > 3) { - drm_err(host, "invalid virtual channel: %u\n", info->channel); + drm_err(host->dev, "invalid virtual channel: %u\n", info->channel); return ERR_PTR(-EINVAL); } dsi = mipi_dsi_device_alloc(host); if (IS_ERR(dsi)) { - drm_err(host, "failed to allocate DSI device %ld\n", + drm_err(host->dev, "failed to allocate DSI device %ld\n", PTR_ERR(dsi)); return dsi; } @@ -227,7 +227,7 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *host, ret = mipi_dsi_device_add(dsi); if (ret) { - drm_err(host, "failed to add DSI device %d\n", ret); + drm_err(host->dev, "failed to add DSI device %d\n", ret); kfree(dsi); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 8257f9d4f619..0a8d62c8f359 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -126,14 +126,14 @@ static void show_leaks(struct drm_mm *mm) list_for_each_entry(node, drm_mm_nodes(mm), node_list) { if (!node->stack) { - DRM_ERROR("node [%08llx + %08llx]: unknown owner\n", - node->start, node->size); + drm_err(NULL, "node [%08llx + %08llx]: unknown owner\n", + node->start, node->size); continue; } stack_depot_snprint(node->stack, buf, BUFSZ, 0); - DRM_ERROR("node [%08llx + %08llx]: inserted at\n%s", - node->start, node->size, buf); + drm_err(NULL, "node [%08llx + %08llx]: inserted at\n%s", + node->start, node->size, buf); } kfree(buf); diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 87eb591fe9b5..b86473ab9ff7 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -513,7 +513,7 @@ void drm_mode_config_cleanup(struct drm_device *dev) if (WARN_ON(!list_empty(&dev->mode_config.connector_list))) { drm_connector_list_iter_begin(dev, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) - DRM_ERROR("connector %s leaked!\n", connector->name); + drm_err(dev, "connector %s leaked!\n", connector->name); drm_connector_list_iter_end(&conn_iter); } diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index be030f4a5311..cc6d1f216e78 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -372,8 +372,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hact_duration_ns < params->hact_ns.min || hact_duration_ns > params->hact_ns.max)) { - DRM_ERROR("Invalid horizontal active area duration: %uns (min: %u, max %u)\n", - hact_duration_ns, params->hact_ns.min, params->hact_ns.max); + drm_err(dev, "Invalid horizontal active area duration: %uns (min: %u, max %u)\n", + hact_duration_ns, params->hact_ns.min, params->hact_ns.max); return -EINVAL; } @@ -384,8 +384,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hblk_duration_ns < params->hblk_ns.min || hblk_duration_ns > params->hblk_ns.max)) { - DRM_ERROR("Invalid horizontal blanking duration: %uns (min: %u, max %u)\n", - hblk_duration_ns, params->hblk_ns.min, params->hblk_ns.max); + drm_err(dev, "Invalid horizontal blanking duration: %uns (min: %u, max %u)\n", + hblk_duration_ns, params->hblk_ns.min, params->hblk_ns.max); return -EINVAL; } @@ -396,8 +396,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hslen_duration_ns < params->hslen_ns.min || hslen_duration_ns > params->hslen_ns.max)) { - DRM_ERROR("Invalid horizontal sync duration: %uns (min: %u, max %u)\n", - hslen_duration_ns, params->hslen_ns.min, params->hslen_ns.max); + drm_err(dev, "Invalid horizontal sync duration: %uns (min: %u, max %u)\n", + hslen_duration_ns, params->hslen_ns.min, params->hslen_ns.max); return -EINVAL; } @@ -408,7 +408,7 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (porches_duration_ns > (params->hfp_ns.max + params->hbp_ns.max) || porches_duration_ns < (params->hfp_ns.min + params->hbp_ns.min))) { - DRM_ERROR("Invalid horizontal porches duration: %uns\n", porches_duration_ns); + drm_err(dev, "Invalid horizontal porches duration: %uns\n", porches_duration_ns); return -EINVAL; } @@ -430,8 +430,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hfp_duration_ns < params->hfp_ns.min || hfp_duration_ns > params->hfp_ns.max)) { - DRM_ERROR("Invalid horizontal front porch duration: %uns (min: %u, max %u)\n", - hfp_duration_ns, params->hfp_ns.min, params->hfp_ns.max); + drm_err(dev, "Invalid horizontal front porch duration: %uns (min: %u, max %u)\n", + hfp_duration_ns, params->hfp_ns.min, params->hfp_ns.max); return -EINVAL; } @@ -442,8 +442,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hbp_duration_ns < params->hbp_ns.min || hbp_duration_ns > params->hbp_ns.max)) { - DRM_ERROR("Invalid horizontal back porch duration: %uns (min: %u, max %u)\n", - hbp_duration_ns, params->hbp_ns.min, params->hbp_ns.max); + drm_err(dev, "Invalid horizontal back porch duration: %uns (min: %u, max %u)\n", + hbp_duration_ns, params->hbp_ns.min, params->hbp_ns.max); return -EINVAL; } @@ -494,8 +494,8 @@ static int fill_analog_mode(struct drm_device *dev, vtotal = vactive + vfp + vslen + vbp; if (params->num_lines != vtotal) { - DRM_ERROR("Invalid vertical total: %upx (expected %upx)\n", - vtotal, params->num_lines); + drm_err(dev, "Invalid vertical total: %upx (expected %upx)\n", + vtotal, params->num_lines); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_modeset_helper.c b/drivers/gpu/drm/drm_modeset_helper.c index f858dfedf2cf..e26b0285dde6 100644 --- a/drivers/gpu/drm/drm_modeset_helper.c +++ b/drivers/gpu/drm/drm_modeset_helper.c @@ -235,7 +235,7 @@ int drm_mode_config_helper_resume(struct drm_device *dev) ret = drm_atomic_helper_resume(dev, dev->mode_config.suspend_state); if (ret) - DRM_ERROR("Failed to resume (%d)\n", ret); + drm_err(dev, "Failed to resume (%d)\n", ret); dev->mode_config.suspend_state = NULL; drm_fb_helper_set_suspend_unlocked(dev->fb_helper, 0); diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 24e7998d1731..fc11efd5e560 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -611,7 +611,7 @@ void drm_plane_force_disable(struct drm_plane *plane) plane->old_fb = plane->fb; ret = plane->funcs->disable_plane(plane, NULL); if (ret) { - DRM_ERROR("failed to disable plane with busy fb\n"); + drm_err(plane->dev, "failed to disable plane with busy fb\n"); plane->old_fb = NULL; return; } diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c index f4e6184d1877..5b0b2140d535 100644 --- a/drivers/gpu/drm/drm_scatter.c +++ b/drivers/gpu/drm/drm_scatter.c @@ -170,9 +170,10 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, j++, tmp++) { if (*tmp != 0xcafebabe && error == 0) { error = 1; - DRM_ERROR("Scatter allocation error, " - "pagelist does not match " - "virtual mapping\n"); + drm_err(dev, + "Scatter allocation error, " + "pagelist does not match " + "virtual mapping\n"); } } tmp = page_address(entry->pagelist[i]); @@ -183,7 +184,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, } } if (error == 0) - DRM_ERROR("Scatter allocation matches pagelist\n"); + drm_err(dev, "Scatter allocation matches pagelist\n"); } #endif diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index f024dc93939e..cdb956af2079 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -547,7 +547,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) return drm_mmap_dma(filp, vma); if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash)) { - DRM_ERROR("Could not find map\n"); + drm_err(dev, "Could not find map\n"); return -EINVAL; }