Re: [PATCH v1 1/1] gpio: mmio: add inverted direction get_set io support
From: Andy Shevchenko
Date: Mon Jul 30 2018 - 13:15:02 EST
On Mon, Jul 30, 2018 at 12:34 PM, Tomer Maimon <tmaimon77@xxxxxxxxx> wrote:
> Add get_set_inv_dir and get_set_multiple_inv_dir I/O functions
> to call the data register when the dirction is input and
> set register when the direction is output.
> the functions will linked to the I/O get functions if the user set
> BGPIOF_INVERTED_REG_DIR flag in the bgpio initialization.
> + /* Make sure we first clear any bits that are zero when we read the register */
> + *bits &= ~*mask;
Theoretically it's possible to get mask and bits longer than one long,
and bitmap API has to be used.
Though, it seems entire driver has been written in an assumption that
it's never happen.
> + gc->get_multiple =
> + bgpio_get_set_multiple_inv_dir;
I think you may keep it on one line.
--
With Best Regards,
Andy Shevchenko