Re: [PATCH v3 2/8] i2c: designware: Move register access detection to common code

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

 



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



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux