summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIker Pedrosa <ikerpedrosam@gmail.com>2025-09-20 11:45:42 +0200
committerJavier Martinez Canillas <javierm@redhat.com>2025-09-26 15:04:45 +0200
commit683bb2424cd5be17cca02067b038e9da5aa68dc6 (patch)
tree0ba22e13917acee25aa014680ff0cb069aed9641
parent2258f03989afb66087538a5d6d56c18ef6532b07 (diff)
drm/solomon: Use drm_WARN_ON_ONCE instead of WARN_ON
To prevent log spam, convert all instances to the DRM-specific drm_WARN_ON_ONCE() macro. This ensures that a warning is emitted only the first time the condition is met for a given device instance, which is the desired behavior within the graphics subsystem. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> Link: https://lore.kernel.org/r/20250920-improve-ssd130x-v2-2-77721e87ae08@gmail.com Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
-rw-r--r--drivers/gpu/drm/solomon/ssd130x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index feaeadc49cce..09792be46f91 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -1393,7 +1393,7 @@ static void ssd130x_primary_plane_reset(struct drm_plane *plane)
{
struct ssd130x_plane_state *ssd130x_state;
- WARN_ON(plane->state);
+ drm_WARN_ON_ONCE(plane->dev, plane->state);
ssd130x_state = kzalloc(sizeof(*ssd130x_state), GFP_KERNEL);
if (!ssd130x_state)
@@ -1408,7 +1408,7 @@ static struct drm_plane_state *ssd130x_primary_plane_duplicate_state(struct drm_
struct ssd130x_plane_state *old_ssd130x_state;
struct ssd130x_plane_state *ssd130x_state;
- if (WARN_ON(!plane->state))
+ if (drm_WARN_ON_ONCE(plane->dev, !plane->state))
return NULL;
old_ssd130x_state = to_ssd130x_plane_state(plane->state);
@@ -1558,7 +1558,7 @@ static void ssd130x_crtc_reset(struct drm_crtc *crtc)
{
struct ssd130x_crtc_state *ssd130x_state;
- WARN_ON(crtc->state);
+ drm_WARN_ON_ONCE(crtc->dev, crtc->state);
ssd130x_state = kzalloc(sizeof(*ssd130x_state), GFP_KERNEL);
if (!ssd130x_state)
@@ -1572,7 +1572,7 @@ static struct drm_crtc_state *ssd130x_crtc_duplicate_state(struct drm_crtc *crtc
struct ssd130x_crtc_state *old_ssd130x_state;
struct ssd130x_crtc_state *ssd130x_state;
- if (WARN_ON(!crtc->state))
+ if (drm_WARN_ON_ONCE(crtc->dev, !crtc->state))
return NULL;
old_ssd130x_state = to_ssd130x_crtc_state(crtc->state);