From: "Avinash.H.M." <avinashhm@ti.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: linux-omap@vger.kernel.org, Rajendra Nayak <rnayak@ti.com>,
Benoit Cousson <b-cousson@ti.com>, Kevin Hilman <khilman@ti.com>
Subject: Re: [PATCH 1/2] OMAP2/3: hwmod: fix the i2c-reset timeout during bootup
Date: Tue, 5 Apr 2011 12:10:46 +0530 [thread overview]
Message-ID: <20110405064046.GA19445@avinash-laptop> (raw)
In-Reply-To: <alpine.DEB.2.00.1104011423220.27897@utopia.booyaka.com>
Hi Paul ,
Thanks for the review.
> > +/* In register I2C_CON, Bit 15 is the I2C enable bit */
> > +#define I2C_EN BIT(15)
> > +#define I2C_CON_OFFSET 0x24
>
> This stuff, along with omap_i2c_reset(), doesn't belong in omap_hwmod.c,
> which is common code that is not I2C-specific. Please put it in
> mach-omap2/i2c.c instead.
I agree. I ll move these I2C specific things from omap_hwmod.c to
mach-omap2/i2c.c.
[...]
> > + */
> > +int omap_i2c_reset(struct omap_hwmod *oh)
> > +{
> > + u32 v = 0;
>
> no need to initialize this to 0
>
> > + int ret = 0, c = 0;
>
> no need to initialize ret to 0
OK . I ll remove initialization of 'v'.
Since now i am moving the function to i2c.c, i can't call _set_softreset
and _write_sysconfig(static functions in omap_hwmod.c). Instead, i ll
set the SOFTRESET bit and write into SYSC register directly. So i do not
need 'ret'. I ll remove it.
Just curios. I understand there is no use of initializing 'v' to 0
here. But by programming practice, i usually initialize local variables
to '0'. Is there anything wrong in doing this ? Any negative impact ?
[...]
> > int omap_hwmod_register(struct omap_hwmod **ohs);
> > +int omap_i2c_reset(struct omap_hwmod *oh);
>
> This should go into plat-omap/include/plat/i2c.h
Sure. I will move this change to plat/i2c.h.
I ll send out the v2 of this shortly after testing.
thanks ,
- avinash
>
> > +
> > struct omap_hwmod *omap_hwmod_lookup(const char *name);
> > int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
> > void *data);
> > --
> > 1.7.1
> >
>
>
> - Paul
next prev parent reply other threads:[~2011-04-05 6:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 15:34 [PATCH 0/2] OMAP2/3: fix the i2c,gpio reset timeouts during boot Avinash.H.M
2011-04-01 15:34 ` [PATCH 1/2] OMAP2/3: hwmod: fix the i2c-reset timeout during bootup Avinash.H.M
2011-04-01 20:28 ` Paul Walmsley
2011-04-05 6:40 ` Avinash.H.M. [this message]
2011-04-01 21:12 ` Kevin Hilman
2011-04-02 7:30 ` Avinash.H.M.
2011-04-01 15:34 ` [PATCH 2/2] OMAP2/3: hwmod: fix gpio-reset timeouts seen " Avinash.H.M
2011-04-20 19:32 ` Paul Walmsley
2011-04-21 6:21 ` Avinash.H.M.
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=20110405064046.GA19445@avinash-laptop \
--to=avinashhm@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
/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