staging: sm750fb: remove duplicate init_status structure
PATCH 1/1 staging: sm750fb: remove duplicate init_status structure
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 <[email protected]>
--- 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(-)
drivers/staging/sm750fb/sm750.c +4 -4
@@ -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 */
drivers/staging/sm750fb/sm750.h +2 -10
@@ -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;
drivers/staging/sm750fb/sm750_hw.c +8 -8
@@ -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,
Signature · 1 line
2.34.1
Quoted 11 lines · Hungyu Lin
struct
init_statusduplicates structinitchip_paramand is only used within the sm750fb driver.Replace the remaining users of struct
init_statuswith structinitchip_param, remove the duplicate structure and eliminate the unnecessary cast inhw_sm750_inithw().No functional change intended.
Signed-off-by Hungyu Lin <[email protected]>---
Looks good to me. :)
Reviewed-by Dan Carpenter <[email protected]>
regards,
dan carpenter