Re: [PATCH v3 1/1 resend] i2c: rcar: modify I2C driver

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

 



Hi Wolfram,

Thank your for the guide.

I have understood your guide.
And I have released version 4 of I2C patch.

Please check it for me.

Thanks,
Nguyen Viet Dung

On 08/28/2013 06:02 PM, Wolfram Sang wrote:
On Tue, Aug 27, 2013 at 04:55:22PM +0900, Nguyen Viet Dung wrote:
This patch modify I2C driver of rcar-H1 to usable on both rcar-H1 and rcar-H2.

Signed-off-by: Nguyen Viet Dung <nv-dung@xxxxxxxxxxx>
Yes, this is much better. Only minor things...

+	switch (priv->devtype) {
+	default:
+	case I2C_RCAR_H1:
+		cdf_width = 2;
+		break;
+	case I2C_RCAR_H2:
+		cdf_width = 3;
+		break;
+	}
+
Please put the default case block at the end.

@@ -632,6 +649,13 @@ static int rcar_i2c_probe(struct platform_device *pdev)
  	bus_speed = 100000; /* default 100 kHz */
  	if (pdata && pdata->bus_speed)
  		bus_speed = pdata->bus_speed;
+
+	if (!pdev->id_entry) {
+		dev_err(&pdev->dev, "no entry\n");
+		return -ENODEV;
+	}
This cannot happen. Since you have 'i2c-rcar' in the id_table, the
driver core will always match against the id_table and there is always a
driver_data defined.


+	priv->devtype = pdev->id_entry->driver_data;
Basically the same, but please use

	platform_get_device_id(pdev)->driver_data;

Otherwise good!

Thanks,

    Wolfram

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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