Re: [PATCH 1/3] media: i2c: max9286: Remove redundant max9286_i2c_mux_state

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

 



Hi Kieran,

On Fri, Dec 6, 2019 at 3:05 PM Kieran Bingham
<kieran.bingham@xxxxxxxxxxxxxxxx> wrote:
> While simplifying the i2c-mux state, the states were stored in an enum
> (initially there were three).
>
> This has now simplified down to 2 states, open and closed - and can be
> represented easily in a bool.
>
> It 'could' also be represented within the mux_channel, but I don't want
> to pollute that further than the '-1' value which is already stored in
> there to represent no channel selected.
>
> Remove the max9286_i2c_mux_state and replace with a bool mux_open flag,
> and move the location within the private struct to be more appropriate.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -144,10 +144,10 @@ struct max9286_priv {
>         struct media_pad pads[MAX9286_N_PADS];
>         struct regulator *regulator;
>         bool poc_enabled;
> -       int mux_state;
>
>         struct i2c_mux_core *mux;
>         unsigned int mux_channel;
> +       bool mux_open;

Please keep all booleans together, to fill up holes due to alignment
restrictions.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[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