[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130923073451.GE3051@katana>
Date: Mon, 23 Sep 2013 09:34:51 +0200
From: Wolfram Sang <wsa@...-dreams.de>
To: Thierry Reding <thierry.reding@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Stephen Warren <swarren@...dotorg.org>,
Grant Likely <grant.likely@...aro.org>,
Rob Herring <rob.herring@...xeda.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-i2c@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH 8/9] of/i2c: Resolve interrupt references at probe time
On Mon, Sep 16, 2013 at 10:32:05AM +0200, Thierry Reding wrote:
> Instead of resolving interrupt references at device creation time, delay
> resolution until probe time. At device creation time, there is nothing
> that can be done if an interrupt parent isn't ready yet, and the device
> will end up with an invalid interrupt number (0).
>
> If the interrupt reference is resolved at probe time, the device's probe
> can be deferred, so that it's interrupt resolution can be retried after
> more devices (possibly including its interrupt parent) have been probed.
>
> However, individual drivers shouldn't be required to do that themselves,
> over and over again, so this commit implements this functionality within
> the I2C core.
>
> Signed-off-by: Thierry Reding <treding@...dia.com>
> ---
> drivers/i2c/i2c-core.c | 23 +++++++++++++++++++++--
> 1 file changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 29d3f04..163a1e8 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -236,6 +236,21 @@ int i2c_recover_bus(struct i2c_adapter *adap)
> return adap->bus_recovery_info->recover_bus(adap);
> }
>
> +static int of_i2c_probe(struct i2c_client *client)
This function should be in the CONFIG_OF block.
> +{
> + struct device_node *np = client->dev.of_node;
> + int ret;
> +
> + /* skip if the device node specifies no interrupts */
> + if (of_get_property(np, "interrupts", NULL)) {
> + ret = of_irq_get(client->dev.of_node, 0, &client->irq);
of_irq_get really sounds as it does refcounting. +1 to change the name.
Thanks,
Wolfram
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists