From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
Eddie James <eajames@linux.vnet.ibm.com>
Cc: linux-i2c <linux-i2c@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
devicetree <devicetree@vger.kernel.org>,
Wolfram Sang <wsa@the-dreams.de>,
Rob Herring <robh+dt@kernel.org>, Joel Stanley <joel@jms.id.au>,
Mark Rutland <mark.rutland@arm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v9 3/7] i2c: fsi: Add port structures
Date: Tue, 05 Jun 2018 09:33:01 +1000 [thread overview]
Message-ID: <414b097e5b8d828ef6dd536e819c2cfab5011912.camel@kernel.crashing.org> (raw)
In-Reply-To: <CAHp75VfMsL3rBMT-SMcSCyuQd2YMexXqkrb=zBYEq0=MO=zHNA@mail.gmail.com>
On Mon, 2018-06-04 at 22:17 +0300, Andy Shevchenko wrote:
>
> > +static int fsi_i2c_remove(struct device *dev)
> > +{
> > + struct fsi_i2c_master *i2c = dev_get_drvdata(dev);
> > + struct fsi_i2c_port *port;
> > +
> > + list_for_each_entry(port, &i2c->ports, list) {
> > + i2c_del_adapter(&port->adapter);
> > + kfree(port);
> > + }
>
> Just to be sure, it will be called if and only if all adapters are not
> busy. Correct?
Actually i2c_del_adapter() will do the right thing. It even waits until
the embedded struct device has been fully released.
As indicated by the comment in there, it should all be turned into
something a bit better, but this is what the i2c layer gives us today.
> > +
> > + return 0;
> > +}
> > +
> > static const struct fsi_device_id fsi_i2c_ids[] = {
> > { FSI_ENGID_I2C, FSI_VERSION_ANY },
> > { 0 }
> > @@ -224,6 +313,7 @@ static int fsi_i2c_probe(struct device *dev)
> > .name = "i2c-fsi",
> > .bus = &fsi_bus_type,
> > .probe = fsi_i2c_probe,
> > + .remove = fsi_i2c_remove,
> > },
> > };
> >
> > --
> > 1.8.3.1
> >
>
>
>
next prev parent reply other threads:[~2018-06-04 23:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 19:00 [PATCH v9 0/7] i2c: Add FSI-attached I2C master algorithm Eddie James
2018-06-04 19:00 ` [PATCH v9 1/7] dt-bindings: i2c: Add FSI-attached I2C master dt binding documentation Eddie James
2018-06-04 19:00 ` [PATCH v9 2/7] i2c: Add FSI-attached I2C master algorithm Eddie James
2018-06-04 19:21 ` Andy Shevchenko
2018-06-04 21:11 ` Eddie James
2018-06-04 23:38 ` Benjamin Herrenschmidt
2018-06-05 9:17 ` Andy Shevchenko
2018-06-05 13:31 ` Eddie James
2018-06-04 19:00 ` [PATCH v9 3/7] i2c: fsi: Add port structures Eddie James
2018-06-04 19:17 ` Andy Shevchenko
2018-06-04 19:40 ` Eddie James
2018-06-04 23:33 ` Benjamin Herrenschmidt [this message]
2018-06-04 19:00 ` [PATCH v9 4/7] i2c: fsi: Add abort and hardware reset procedures Eddie James
2018-06-04 19:00 ` [PATCH v9 5/7] i2c: fsi: Add transfer implementation Eddie James
2018-06-04 19:14 ` Andy Shevchenko
2018-06-04 19:37 ` Eddie James
2018-06-04 19:45 ` Peter Rosin
2018-06-04 21:12 ` Eddie James
2018-06-04 19:00 ` [PATCH v9 6/7] i2c: fsi: Add I2C master locking Eddie James
2018-06-04 19:00 ` [PATCH v9 7/7] i2c: fsi: Add bus recovery Eddie James
2018-06-04 19:22 ` [PATCH v9 0/7] i2c: Add FSI-attached I2C master algorithm Andy Shevchenko
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=414b097e5b8d828ef6dd536e819c2cfab5011912.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=eajames@linux.vnet.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@jms.id.au \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=wsa@the-dreams.de \
/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).