All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ali Köse" <shroot1337@gmail.com>
To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com
Cc: gregkh@linuxfoundation.org, rppt@kernel.org,
	linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] staging: sm750fb: Replace set_DAC macro with a static function
Date: Sat, 14 Nov 2026 13:02:05 +0300	[thread overview]
Message-ID: <20261114100207.9124-2-shroot1337@gmail.com> (raw)
In-Reply-To: <20261114100207.9124-1-shroot1337@gmail.com>

Replace the set_DAC macro with a static function named set_dac().
The helper has only one caller, so keep it local to ddk750_display.c
and remove the macro from ddk750_power.h.

This provides parameter type checking and follows kernel naming
conventions without changing the register operation.

Signed-off-by: Ali Köse <shroot1337@gmail.com>
---
 drivers/staging/sm750fb/ddk750_display.c | 8 +++++++-
 drivers/staging/sm750fb/ddk750_power.h   | 5 -----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c
index 4e390541a507..d619e00fd88e 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -4,6 +4,12 @@
 #include "ddk750_display.h"
 #include "ddk750_power.h"
 
+static void set_dac(unsigned int off)
+{
+	poke32(MISC_CTRL,
+	       (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | off);
+}
+
 static void set_display_control(int ctrl, int disp_state)
 {
 	/* state != 0 means turn on both timing & plane en_bit */
@@ -151,7 +157,7 @@ void ddk750_set_logical_disp_out(enum disp_output output)
 	}
 
 	if (output & DAC_USAGE)
-		set_DAC((output & DAC_MASK) >> DAC_OFFSET);
+		set_dac((output & DAC_MASK) >> DAC_OFFSET);
 
 	if (output & DPMS_USAGE)
 		ddk750_set_dpms((output & DPMS_MASK) >> DPMS_OFFSET);
diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
index 0c4ab2120385..61f8608e59de 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -9,11 +9,6 @@ enum dpms {
 	CRT_DPMS_OFF = 0x3,
 };
 
-#define set_DAC(off) {							\
-	poke32(MISC_CTRL,						\
-	       (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \
-}
-
 void ddk750_set_dpms(enum dpms state);
 void sm750_set_power_mode(unsigned int mode);
 void sm750_set_current_gate(unsigned int gate);
-- 
2.53.0


  reply	other threads:[~2026-11-14 10:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 10:02 [PATCH 0/3] staging: sm750fb: Clean up helpers and fix DAC power-off handling Ali Köse
2026-11-14 10:02 ` Ali Köse [this message]
2026-11-14 10:02 ` [PATCH 2/3] staging: sm750fb: Fix DAC power-off bit handling Ali Köse
2026-11-14 10:02 ` [PATCH 3/3] staging: sm750fb: Remove empty software I2C acknowledgement helper Ali Köse

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=20261114100207.9124-2-shroot1337@gmail.com \
    --to=shroot1337@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=rppt@kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    /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.