Re: [PATCH v2] staging: sm750fb: remove unused variable
From: Dan Carpenter
Date: Fri May 29 2026 - 06:39:25 EST
On Fri, May 29, 2026 at 03:42:42PM +0530, Onish Sharma wrote:
> Remove the set_all_eng_off flag and its associated cleanup logic.
> The variable is redundant as the hardware should be initialized to a
> known state regardless of prior usage.
>
> Suggested-by: Dan Carpenter <error27@xxxxxxxxx>
> Signed-off-by: Onish Sharma <neharora23587@xxxxxxxxx>
> ---
Sorry, miscommunication. This breaks the driver. This is also a bit
more involved than I thought...
There are two structs:
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;
};
And struct initchip_param. The initchip_param is exactly the same but
with all the struct members renamed and comments added. They have to
match because we cast back and forth.
Why do we have two different struct that have to be the same? You might
think it is for API, but as near as I can see that is not the case.
Maybe it was at some point? We should get rid of one struct. Which
everyone is API is the one we should keep. If neither is API then get
rid of init_status and keep initchip_param.
After that we can talk about getting rid of setAllEngOff/set_all_eng_off.
regards,
dan carpenter