From: Wolfram Sang <wsa@the-dreams.de>
To: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
kuninori.morimoto.gx@renesas.com
Subject: Re: [PATCH v3 1/1 resend] i2c: rcar: modify I2C driver
Date: Wed, 28 Aug 2013 11:02:47 +0200 [thread overview]
Message-ID: <20130828090246.GC4086@katana> (raw)
In-Reply-To: <1377590122-9309-2-git-send-email-nv-dung@jinso.co.jp>
[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]
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@jinso.co.jp>
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-08-28 9:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-27 7:55 [PATCH v3 0/1 resend] ARM: shmobile: r8a7790: add I2C support Nguyen Viet Dung
2013-08-27 7:55 ` [PATCH v3 1/1 resend] i2c: rcar: modify I2C driver Nguyen Viet Dung
2013-08-28 9:02 ` Wolfram Sang [this message]
2013-08-29 9:46 ` Nguyen Viet Dung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130828090246.GC4086@katana \
--to=wsa@the-dreams.de \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nv-dung@jinso.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox