* [PATCH] staging: sm750fb: remove duplicate init_status structure
@ 2026-05-30 22:24 Hungyu Lin
2026-06-01 11:09 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Hungyu Lin @ 2026-05-30 22:24 UTC (permalink / raw)
To: sudipm.mukherjee, teddy.wang
Cc: gregkh, linux-fbdev, linux-staging, linux-kernel, error27,
Hungyu Lin
struct init_status duplicates struct initchip_param and is only used
within the sm750fb driver.
Replace the remaining users of struct init_status with
struct initchip_param, remove the duplicate structure and eliminate
the unnecessary cast in hw_sm750_inithw().
No functional change intended.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 8 ++++----
drivers/staging/sm750fb/sm750.h | 12 ++----------
drivers/staging/sm750fb/sm750_hw.c | 16 ++++++++--------
3 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..5986dbef67c0 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -844,11 +844,11 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
swap = 0;
- sm750_dev->init_parm.chip_clk = 0;
- sm750_dev->init_parm.mem_clk = 0;
- sm750_dev->init_parm.master_clk = 0;
+ sm750_dev->init_parm.chip_clock = 0;
+ sm750_dev->init_parm.mem_clock = 0;
+ sm750_dev->init_parm.master_clock = 0;
sm750_dev->init_parm.power_mode = 0;
- sm750_dev->init_parm.setAllEngOff = 0;
+ sm750_dev->init_parm.set_all_eng_off = 0;
sm750_dev->init_parm.reset_memory = 1;
/* defaultly turn g_hwcursor on for both view */
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index d2c522e67f26..81fbf32865c3 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef LYNXDRV_H_
#define LYNXDRV_H_
+#include "ddk750_chip.h"
#define FB_ACCEL_SMI 0xab
@@ -38,15 +39,6 @@ enum sm750_path {
sm750_pnc = 3, /* panel and crt */
};
-struct init_status {
- ushort power_mode;
- /* below three clocks are in unit of MHZ*/
- ushort chip_clk;
- ushort mem_clk;
- ushort master_clk;
- ushort setAllEngOff;
- ushort reset_memory;
-};
struct lynx_accel {
/* base virtual address of DPR registers */
@@ -102,7 +94,7 @@ struct sm750_dev {
/* locks*/
spinlock_t slock;
- struct init_status init_parm;
+ struct initchip_param init_parm;
enum sm750_pnltype pnltype;
enum sm750_dataflow dataflow;
int nocrt;
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 34a837fb4b64..54c1b241ae6e 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -66,20 +66,20 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
{
- struct init_status *parm;
+ struct initchip_param *parm;
parm = &sm750_dev->init_parm;
- if (parm->chip_clk == 0)
- parm->chip_clk = (sm750_get_chip_type() == SM750LE) ?
+ if (parm->chip_clock == 0)
+ parm->chip_clock = (sm750_get_chip_type() == SM750LE) ?
DEFAULT_SM750LE_CHIP_CLOCK :
DEFAULT_SM750_CHIP_CLOCK;
- if (parm->mem_clk == 0)
- parm->mem_clk = parm->chip_clk;
- if (parm->master_clk == 0)
- parm->master_clk = parm->chip_clk / 3;
+ if (parm->mem_clock == 0)
+ parm->mem_clock = parm->chip_clock;
+ if (parm->master_clock == 0)
+ parm->master_clock = parm->chip_clock / 3;
- ddk750_init_hw((struct initchip_param *)&sm750_dev->init_parm);
+ ddk750_init_hw(&sm750_dev->init_parm);
/* for sm718, open pci burst */
if (sm750_dev->devid == 0x718) {
poke32(SYSTEM_CTRL,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] staging: sm750fb: remove duplicate init_status structure
2026-05-30 22:24 [PATCH] staging: sm750fb: remove duplicate init_status structure Hungyu Lin
@ 2026-06-01 11:09 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-06-01 11:09 UTC (permalink / raw)
To: Hungyu Lin
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
On Sat, May 30, 2026 at 10:24:32PM +0000, Hungyu Lin wrote:
> struct init_status duplicates struct initchip_param and is only used
> within the sm750fb driver.
>
> Replace the remaining users of struct init_status with
> struct initchip_param, remove the duplicate structure and eliminate
> the unnecessary cast in hw_sm750_inithw().
>
> No functional change intended.
>
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
Looks good to me. :)
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-01 11:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-30 22:24 [PATCH] staging: sm750fb: remove duplicate init_status structure Hungyu Lin
2026-06-01 11:09 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox