On Mon, Mar 23, 2015 at 01:52:13PM +0000, Lee Jones wrote:
> On Tue, 17 Mar 2015, Charles Keepax wrote:
> 
> > wm5102 applies a custom hardware boot sequence, for this the SYSCLK
> > needs to be enabled. This patch factors out the code that enables
> > SYSCLK for this sequence such that it can be used for other boot time
> > operations that require SYSCLK.
> > 
> > Signed-off-by: Charles Keepax <[email protected]>
> > ---
<snip>
> > +
> > +static inline int arizona_apply_hardware_patch(struct arizona *arizona)
> > +{
> > +   return arizona_exec_with_sysclk(arizona, arizona_hardware_patch_wseq);
> 
> Not sure I like this much.
> 
> What's the reason for over-complicating this?  Can you just:
> 
> arizona_exec_with_sysclk(arizona);
> arizona_hardware_patch_wseq(arizona); 
> 
> ... or if you need that call to be in the middle, split the calls up
> further.
> 

Yeah, it was just a handy way to store the state and keep the
amount of code down. But I don't really have any problem with
explicitly storing the state if you prefer that.

So would probably look something like:

struct sysclk_state;
int ret;

ret = arizona_force_sysclk(arizona, &sysclk_state);
if (ret) {
        //Handle error
}
ret = arizona_hardware_patch_wseq(arizona);
if (ret) {
        //Handle error
}
ret = arizona_restore_sysclk(arizona, &sysclk_state);
if (ret) {
        //Handle error
}

I will assume you want it updated to look like this so let me
know if not.

Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to