[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKDJKT4Ws3XusYJTkojjeMvwxc2R9BRYpmn6HwGOH_8QF+pe0A@mail.gmail.com>
Date: Thu, 26 May 2016 21:37:21 +0530
From: Manish Badarkhe <badarkhe.manish@...il.com>
To: Ravikumar Kattekola <rk@...com>
Cc: Tony Lindgren <tony@...mide.com>, wsa@...-dreams.de,
linux-omap@...r.kernel.org, linux-i2c@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC 1/1] drivers: i2c: omap: Add slave support
Hi Ravikumar
Some sanity comments, just good to have.
> +#ifdef CONFIG_I2C_SLAVE
> +static int omap_i2c_slave_irq(struct omap_i2c_dev *omap)
> +{
> + u16 stat_raw;
> + u16 stat;
> + u16 bits;
> + u8 value;
> +
> + stat_raw = omap_i2c_read_reg(omap, OMAP_I2C_IP_V2_IRQSTATUS_RAW);
> + bits = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG);
> + stat_raw &= bits;
> +
> + if (stat_raw & OMAP_I2C_STAT_AAS) {
> + omap_i2c_ack_stat(omap, OMAP_I2C_STAT_AAS);
> + stat_raw &= ~OMAP_I2C_STAT_AAS;
> + }
> +
> +out:
> + return 0;
> +}
> +#endif
This function always return 0.
> +#ifdef CONFIG_I2C_SLAVE
> +static int omap_i2c_reg_slave(struct i2c_client *slave)
> +{
> + struct omap_i2c_dev *omap = i2c_get_adapdata(slave->adapter);
> + u16 reg;
> + int ret = 0;
> + /* Enable necessary interrupts */
> + omap_i2c_write_reg(omap, OMAP_I2C_IE_REG, omap->iestate);
> +
> + return 0;
> +
> +}
Better to return "ret" here as already been initialized to 0
> +
> +static int omap_i2c_unreg_slave(struct i2c_client *slave)
> +{
> + struct omap_i2c_dev *omap = i2c_get_adapdata(slave->adapter);
> + u16 reg;
> +
> + pm_runtime_put(omap->dev);
> + return 0;
> +}
> +#endif
This function always return 0
Regards
Manish Badarkhe
Powered by blists - more mailing lists