* [PATCH v2 04/11] spi: spi-ep93xx: get platform resources early in (*probe)
@ 2013-07-02 17:07 H Hartley Sweeten
2013-07-03 18:03 ` Mika Westerberg
2013-07-03 18:22 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: H Hartley Sweeten @ 2013-07-02 17:07 UTC (permalink / raw)
To: Linux Kernel
Cc: spi-devel-general, Ryan Mallon, mika.westerberg, broonie,
grant.likely, hsweeten
Get the platform resources early in the (*probe) to minimize the number
of goto's in the error path.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Mark Brown <broonie@kernel.org>
Cc: Grant Likely <grant.likely@linaro.org>
---
drivers/spi/spi-ep93xx.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index d5e6420..c2660c2 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -991,6 +991,18 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
info = pdev->dev.platform_data;
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0) {
+ dev_err(&pdev->dev, "failed to get irq resources\n");
+ return -EBUSY;
+ }
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev, "unable to get iomem resource\n");
+ return -ENODEV;
+ }
+
master = spi_alloc_master(&pdev->dev, sizeof(*espi));
if (!master) {
dev_err(&pdev->dev, "failed to allocate spi master\n");
@@ -1027,20 +1039,6 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
espi->min_rate = clk_get_rate(espi->clk) / (254 * 256);
espi->pdev = pdev;
- irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- error = -EBUSY;
- dev_err(&pdev->dev, "failed to get irq resources\n");
- goto fail_put_clock;
- }
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "unable to get iomem resource\n");
- error = -ENODEV;
- goto fail_put_clock;
- }
-
espi->sspdr_phys = res->start + SSPDR;
espi->regs_base = devm_ioremap_resource(&pdev->dev, res);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 04/11] spi: spi-ep93xx: get platform resources early in (*probe)
2013-07-02 17:07 [PATCH v2 04/11] spi: spi-ep93xx: get platform resources early in (*probe) H Hartley Sweeten
@ 2013-07-03 18:03 ` Mika Westerberg
2013-07-03 18:22 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2013-07-03 18:03 UTC (permalink / raw)
To: H Hartley Sweeten
Cc: Linux Kernel, spi-devel-general, Ryan Mallon, broonie,
grant.likely, hsweeten
On Tue, Jul 02, 2013 at 10:07:53AM -0700, H Hartley Sweeten wrote:
> Get the platform resources early in the (*probe) to minimize the number
> of goto's in the error path.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ryan Mallon <rmallon@gmail.com>
> Cc: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Mika Westerberg <mika.westerberg@iki.fi>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 04/11] spi: spi-ep93xx: get platform resources early in (*probe)
2013-07-02 17:07 [PATCH v2 04/11] spi: spi-ep93xx: get platform resources early in (*probe) H Hartley Sweeten
2013-07-03 18:03 ` Mika Westerberg
@ 2013-07-03 18:22 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-07-03 18:22 UTC (permalink / raw)
To: H Hartley Sweeten
Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
grant.likely, hsweeten
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
On Tue, Jul 02, 2013 at 10:07:53AM -0700, H Hartley Sweeten wrote:
> Get the platform resources early in the (*probe) to minimize the number
> of goto's in the error path.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-03 18:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-02 17:07 [PATCH v2 04/11] spi: spi-ep93xx: get platform resources early in (*probe) H Hartley Sweeten
2013-07-03 18:03 ` Mika Westerberg
2013-07-03 18:22 ` Mark Brown
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).