From: Ben Dooks <ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: Michael Williamson
<michael.williamson-wZX4cNJlHJ2sVWG7oymsAA@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org,
chaithrika-l0cyMroinI0@public.gmane.org,
pjohn-k0rHJ+Hhz/SB+jHODAdFcQ@public.gmane.org,
nageswari-l0cyMroinI0@public.gmane.org,
dirk.behme-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH] i2c-davinci: Fix use of default platform data if none supplied.
Date: Wed, 22 Sep 2010 01:24:42 +0100 [thread overview]
Message-ID: <20100922002442.GJ7494@trinity.fluff.org> (raw)
In-Reply-To: <1283616468-6344-1-git-send-email-michael.williamson-wZX4cNJlHJ2sVWG7oymsAA@public.gmane.org>
On Sat, Sep 04, 2010 at 12:07:48PM -0400, Michael Williamson wrote:
> There is a bug in the i2c-davinci device init routine that attempts
> to use default platform data if none is supplied (e.g., is NULL).
> This patch fixes the bug.
>
> Signed-off-by: Michael Williamson <michael.williamson-wZX4cNJlHJ2sVWG7oymsAA@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-davinci.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
> index 2222c87..6d4eeeb 100644
> --- a/drivers/i2c/busses/i2c-davinci.c
> +++ b/drivers/i2c/busses/i2c-davinci.c
> @@ -235,10 +235,12 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
> */
> static int i2c_davinci_init(struct davinci_i2c_dev *dev)
> {
> - struct davinci_i2c_platform_data *pdata = dev->dev->platform_data;
> + struct davinci_i2c_platform_data *pdata;
>
> - if (!pdata)
> - pdata = &davinci_i2c_platform_data_default;
> + if (!dev->dev->platform_data)
> + dev->dev->platform_data = &davinci_i2c_platform_data_default;
> +
> + pdata = dev->dev->platform_data;
At first glance this looks like a code shift, however is the platform
data used later in the driver by referencing the device.platform_data
field?
Could you rewrite the header to show this, and if possible note any
actual oops report that has been seen with this.
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
next prev parent reply other threads:[~2010-09-22 0:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-04 16:07 [PATCH] i2c-davinci: Fix use of default platform data if none supplied Michael Williamson
[not found] ` <1283616468-6344-1-git-send-email-michael.williamson-wZX4cNJlHJ2sVWG7oymsAA@public.gmane.org>
2010-09-22 0:24 ` Ben Dooks [this message]
[not found] ` <20100922002442.GJ7494-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2010-09-22 1:02 ` Michael Williamson
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=20100922002442.GJ7494@trinity.fluff.org \
--to=ben-i2c-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=chaithrika-l0cyMroinI0@public.gmane.org \
--cc=dirk.behme-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=michael.williamson-wZX4cNJlHJ2sVWG7oymsAA@public.gmane.org \
--cc=nageswari-l0cyMroinI0@public.gmane.org \
--cc=pjohn-k0rHJ+Hhz/SB+jHODAdFcQ@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).