Re: [RFC 2/5] clk: shmobile: cpg-mssr: add generic support for read-only DIV6 clocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > -               if (core->type == CLK_TYPE_FF) {
> > -                       clk = clk_register_fixed_factor(NULL, core->name,
> > -                                                       parent_name, 0,
> > -                                                       core->mult, core->div);
> > -               } else {
> > +
> > +               if (core->type == CLK_TYPE_DIV6_RO)
> > +                       /* Multiply with the DIV6 register value */
> > +                       div *= (readl(priv->base + core->offset) & 0x3f) + 1;
> > +
> > +               if (core->type == CLK_TYPE_DIV6P1) {
> >                         clk = cpg_div6_register(core->name, 1, &parent_name,
> >                                                 priv->base + core->offset);
> > +               } else {
> > +                       clk = clk_register_fixed_factor(NULL, core->name,
> > +                                                       parent_name, 0,
> > +                                                       core->mult, div);
> >                 }
> 
> Please use a switch() instead of if / else. It avoids people wondering where
> the "core->type == CLK_TYPE_FF" case went to, until they realize it's covered
> by the else.

Are you sure? It is as you say when reading the diff. But looking at the
source file after the patch, I think this is easily understandable?

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux