From: rabin@rab.in (Rabin Vincent)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] GPIO PL061: Adding Clk framework support
Date: Thu, 15 Jul 2010 21:39:22 +0530 [thread overview]
Message-ID: <20100715160922.GA4119@debian> (raw)
In-Reply-To: <20100715095637.GF26212@n2100.arm.linux.org.uk>
On Thu, Jul 15, 2010 at 10:56:37AM +0100, Russell King - ARM Linux wrote:
> +static int amba_get_enable_pclk(struct amba_device *pcdev)
> +{
> + struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
> + int ret;
> +
> + pcdev->pclk = pclk;
> +
> + if (IS_ERR(pclk))
> + return PTR_ERR(pclk);
> +
> + ret = clk_enable(pclk);
> + if (ret)
> + clk_put(pclk);
> +
> + return ret;
> +}
> +
...
> @@ -130,17 +155,33 @@ static int amba_probe(struct device *dev)
> {
> struct amba_device *pcdev = to_amba_device(dev);
> struct amba_driver *pcdrv = to_amba_driver(dev->driver);
> - struct amba_id *id;
> + struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
> + int ret;
>
> - id = amba_lookup(pcdrv->id_table, pcdev);
> + do {
> + ret = amba_get_enable_pclk(pcdev);
> + if (ret)
> + break;
> +
> + ret = pcdrv->probe(pcdev, id);
> + if (ret == 0)
> + break;
>
> - return pcdrv->probe(pcdev, id);
> + amba_put_disable_pclk(pcdev);
> + } while (0);
> +
> + return ret;
> }
In your earlier patch, you proceeded with the probe if the error from
clk_get() was -ENOENT, but not in this version. Isn't the -ENOENT
special handling preferable, since it avoids the need to change all
existing platforms?
next prev parent reply other threads:[~2010-07-15 16:09 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 5:07 [PATCH v4] GPIO PL061: Adding Clk framework support Viresh KUMAR
2010-06-22 17:06 ` Baruch Siach
2010-07-09 12:40 ` Russell King - ARM Linux
2010-07-09 23:55 ` Linus Walleij
2010-07-10 7:19 ` Russell King - ARM Linux
2010-07-10 7:30 ` Russell King - ARM Linux
2010-07-10 15:36 ` Linus Walleij
2010-07-13 7:44 ` Russell King - ARM Linux
2010-07-13 11:00 ` Linus Walleij
2010-07-13 18:26 ` Russell King - ARM Linux
2010-07-15 6:02 ` Viresh KUMAR
2010-07-15 8:30 ` Russell King - ARM Linux
2010-07-15 9:35 ` Viresh KUMAR
2010-07-15 9:44 ` Linus Walleij
2010-07-15 9:56 ` Russell King - ARM Linux
2010-07-15 16:09 ` Rabin Vincent [this message]
2010-07-15 16:22 ` Russell King - ARM Linux
2010-07-29 23:22 ` Kevin Wells
2010-07-30 7:09 ` Russell King - ARM Linux
2010-08-03 0:40 ` Kevin Wells
2010-08-03 13:00 ` Linus Walleij
2010-08-03 20:36 ` Kevin Wells
2010-08-03 21:23 ` Russell King - ARM Linux
2010-07-30 15:19 ` Linus Walleij
2010-07-12 4:07 ` Viresh KUMAR
2010-07-12 7:53 ` Linus Walleij
2010-07-12 8:07 ` Russell King - ARM Linux
2010-07-12 8:18 ` Viresh KUMAR
2010-07-12 8:34 ` Russell King - ARM Linux
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=20100715160922.GA4119@debian \
--to=rabin@rab.in \
--cc=linux-arm-kernel@lists.infradead.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).