On 06/11/2018 06:13 PM, Andy Shevchenko wrote:
On Mon, 2018-06-11 at 17:22 +0300, Jarkko Nikula wrote:
+ int ret = 0;
Redundant assignment.
Grr. I'm obviously blind to these.
+
+ ret = i2c_dw_acquire_lock(dev);
+ if (ret)
+ return ret;
+ blank line?
Will do.
+ reg = dw_readl(dev, DW_IC_COMP_TYPE);
+ i2c_dw_release_lock(dev);
+
+ if (reg == ___constant_swab32(DW_IC_COMP_TYPE_VALUE)) {
+ /* Configure register endianess access */
+ dev->flags |= ACCESS_SWAP;
+ } else if (reg == (DW_IC_COMP_TYPE_VALUE & 0x0000ffff)) {
+ /* Configure register access mode 16bit */
+ dev->flags |= ACCESS_16BIT;
+ } else if (reg != DW_IC_COMP_TYPE_VALUE) {
+ dev_err(dev->dev,
+ "Unknown Synopsys component type: 0x%08x\n",
reg);
+ ret = -ENODEV;
+ }
+
+ return ret;
Dunno if it makes sense
... {
...
return -ENOVEV;
}
return 0;
Can change.
--
Jarkko