Re: [PATCH 08/10] i2c: iproc: Move function and avoid prototypes

Mukesh Kumar Savaliya
2025-04-19T19:46:42Z

On 4/19/2025 2:46 AM, Andi Shyti wrote:
> Shuffle a bit the code in order to avoid prototypes.
>
> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
> ---
> drivers/i2c/busses/i2c-bcm-iproc.c | 143 ++++++++++++++---------------
> 1 file changed, 69 insertions(+), 74 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
> index d25b393f456b..74903edb4925 100644
> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> @@ -224,11 +224,6 @@ static void slave_rx_tasklet_fn(unsigned long);
[...]
> +static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave)
> +{
> + struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter);
> +
> + if (iproc_i2c->slave)
> + return -EBUSY;
> +
> + if (slave->flags & I2C_CLIENT_TEN)
> + return -EAFNOSUPPORT;
> +
> + iproc_i2c->slave = slave;
> +
> + tasklet_init(&iproc_i2c->slave_rx_tasklet, slave_rx_tasklet_fn,
> + (unsigned long)iproc_i2c);
> +
> + bcm_iproc_i2c_slave_init(iproc_i2c, false);
one line gap/space before return.
> + return 0;
> +}
> +
> +static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave)
> +{
> + u32 tmp;
> + struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter);
Reverse xmas tree alignment during decalarations please ?
> +
> + if (!iproc_i2c->slave)
> + return -EINVAL;
> + …