From: "Uwe Kleine-König" <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3] i2c: new bus driver for efm32
Date: Mon, 24 Mar 2014 19:41:14 +0100 [thread overview]
Message-ID: <20140324184114.GK23076@pengutronix.de> (raw)
In-Reply-To: <20140324170131.GB7524@katana>
On Mon, Mar 24, 2014 at 06:01:31PM +0100, Wolfram Sang wrote:
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-efm32.txt
> > @@ -0,0 +1,34 @@
> > +* Energymicro efm32 i2c controller
> > +
> > +Required properties :
> > +
> > + - reg : Offset and length of the register set for the device
> > + - compatible : should be "efm32,i2c"
>
> Ehrm, come to think of it, shouldn't that actually be "energymicro, efm32-i2c"
> or similar to match the "vendor,product" pattern?
yes.
>
> > +config I2C_EFM32
> > + tristate "EFM32 I2C controller"
> > + depends on OF && (ARCH_EFM32 || COMPILE_TEST)
>
> Is EFM32 DT only? Do we need the dependency on OF?
yes, efm32 is DT only. Still for the COMPILE_TEST branch the OF is
needed.
> > + help
> > + This driver supports the i2c block found in Energy Micro's EFM32
> > + SoCs.
> > +
>
> ...
>
> > +static int efm32_i2c_master_xfer(struct i2c_adapter *adap,
> > + struct i2c_msg *msgs, int num)
> > +{
> > + struct efm32_i2c_ddata *ddata = i2c_get_adapdata(adap);
> > + int ret;
> > +
> > + if (ddata->msgs)
> > + return -EBUSY;
> > +
> > + ddata->msgs = msgs;
> > + ddata->num_msgs = num;
> > + ddata->current_word = 0;
> > + ddata->current_msg = 0;
> > + ddata->retval = -EIO;
> > +
> > + reinit_completion(&ddata->done);
> > +
> > + dev_dbg(&ddata->adapter.dev, "state: %08x, status: %08x\n",
> > + efm32_i2c_read32(ddata, REG_STATE),
> > + efm32_i2c_read32(ddata, REG_STATUS));
> > +
> > + efm32_i2c_send_next_msg(ddata);
> > +
> > + wait_for_completion(&ddata->done);
> > +
> > + if (ddata->current_msg >= ddata->num_msgs)
> > + ret = ddata->num_msgs;
> > + else
> > + ret = ddata->retval;
> > +
> > + ddata->msgs = NULL;
>
> Setting NULL should not be needed?
Right, that's a left over from the locking stuff.
> > +
> > + return ret;
> > +}
> > +
>
> And checkpatch said:
>
> WARNING: braces {} are not necessary for any arm of this statement
> #345: FILE: drivers/i2c/busses/i2c-efm32.c:239:
> + if (cur_msg->flags & I2C_M_RD) {
> ...
ok.
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2014-03-24 18:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 15:03 [PATCH v3] i2c: new bus driver for efm32 Uwe Kleine-König
[not found] ` <1395414236-22647-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-03-24 17:01 ` Wolfram Sang
2014-03-24 18:41 ` Uwe Kleine-König [this message]
[not found] ` <20140324184114.GK23076-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-03-24 19:08 ` Wolfram Sang
2014-03-25 9:07 ` Uwe Kleine-König
[not found] ` <20140325090700.GL23076-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-03-25 9:11 ` Wolfram Sang
[not found] ` <CAO=4fJM9y6yML77oJ3uW2Wz=nEhm=xA-bKoMHd8DXdxw0z8p7Q@mail.gmail.com>
[not found] ` <CAO=4fJM9y6yML77oJ3uW2Wz=nEhm=xA-bKoMHd8DXdxw0z8p7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-25 12:00 ` Wolfram Sang
2014-03-25 14:01 ` Joe Perches
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=20140324184114.GK23076@pengutronix.de \
--to=u.kleine-koenig-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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).