All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-02 17:08 ` H Hartley Sweeten
  0 siblings, 0 replies; 11+ messages in thread
From: H Hartley Sweeten @ 2013-07-02 17:08 UTC (permalink / raw)
  To: Linux Kernel
  Cc: spi-devel-general, Ryan Mallon, mika.westerberg, broonie,
	grant.likely, hsweeten

Use devm_clk_get() so that the clk_put() happens automatically when
the last reference to this driver is dropped.

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 | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index c2660c2..c1a610e 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -1021,7 +1021,7 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
 
 	espi = spi_master_get_devdata(master);
 
-	espi->clk = clk_get(&pdev->dev, NULL);
+	espi->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(espi->clk)) {
 		dev_err(&pdev->dev, "unable to get spi clock\n");
 		error = PTR_ERR(espi->clk);
@@ -1044,14 +1044,14 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
 	espi->regs_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(espi->regs_base)) {
 		error = PTR_ERR(espi->regs_base);
-		goto fail_put_clock;
+		goto fail_release_master;
 	}
 
 	error = devm_request_irq(&pdev->dev, irq, ep93xx_spi_interrupt,
 				0, "ep93xx-spi", espi);
 	if (error) {
 		dev_err(&pdev->dev, "failed to request irq\n");
-		goto fail_put_clock;
+		goto fail_release_master;
 	}
 
 	if (info->use_dma && ep93xx_spi_setup_dma(espi))
@@ -1085,8 +1085,6 @@ fail_free_queue:
 	destroy_workqueue(espi->wq);
 fail_free_dma:
 	ep93xx_spi_release_dma(espi);
-fail_put_clock:
-	clk_put(espi->clk);
 fail_release_master:
 	spi_master_put(master);
 
@@ -1122,7 +1120,6 @@ static int ep93xx_spi_remove(struct platform_device *pdev)
 	spin_unlock_irq(&espi->lock);
 
 	ep93xx_spi_release_dma(espi);
-	clk_put(espi->clk);
 
 	spi_unregister_master(master);
 	return 0;
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-02 17:08 ` H Hartley Sweeten
  0 siblings, 0 replies; 11+ messages in thread
From: H Hartley Sweeten @ 2013-07-02 17:08 UTC (permalink / raw)
  To: Linux Kernel
  Cc: Ryan Mallon, mika.westerberg-X3B1VOXEql0,
	hsweeten-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR,
	broonie-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Use devm_clk_get() so that the clk_put() happens automatically when
the last reference to this driver is dropped.

Signed-off-by: H Hartley Sweeten <hsweeten-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR@public.gmane.org>
Cc: Ryan Mallon <rmallon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mika Westerberg <mika.westerberg-X3B1VOXEql0@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/spi/spi-ep93xx.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index c2660c2..c1a610e 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -1021,7 +1021,7 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
 
 	espi = spi_master_get_devdata(master);
 
-	espi->clk = clk_get(&pdev->dev, NULL);
+	espi->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(espi->clk)) {
 		dev_err(&pdev->dev, "unable to get spi clock\n");
 		error = PTR_ERR(espi->clk);
@@ -1044,14 +1044,14 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
 	espi->regs_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(espi->regs_base)) {
 		error = PTR_ERR(espi->regs_base);
-		goto fail_put_clock;
+		goto fail_release_master;
 	}
 
 	error = devm_request_irq(&pdev->dev, irq, ep93xx_spi_interrupt,
 				0, "ep93xx-spi", espi);
 	if (error) {
 		dev_err(&pdev->dev, "failed to request irq\n");
-		goto fail_put_clock;
+		goto fail_release_master;
 	}
 
 	if (info->use_dma && ep93xx_spi_setup_dma(espi))
@@ -1085,8 +1085,6 @@ fail_free_queue:
 	destroy_workqueue(espi->wq);
 fail_free_dma:
 	ep93xx_spi_release_dma(espi);
-fail_put_clock:
-	clk_put(espi->clk);
 fail_release_master:
 	spi_master_put(master);
 
@@ -1122,7 +1120,6 @@ static int ep93xx_spi_remove(struct platform_device *pdev)
 	spin_unlock_irq(&espi->lock);
 
 	ep93xx_spi_release_dma(espi);
-	clk_put(espi->clk);
 
 	spi_unregister_master(master);
 	return 0;
-- 
1.8.1.4


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-03 18:04   ` Mika Westerberg
  0 siblings, 0 replies; 11+ messages in thread
From: Mika Westerberg @ 2013-07-03 18:04 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:08:21AM -0700, H Hartley Sweeten wrote:
> Use devm_clk_get() so that the clk_put() happens automatically when
> the last reference to this driver is dropped.
> 
> 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] 11+ messages in thread

* Re: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-03 18:04   ` Mika Westerberg
  0 siblings, 0 replies; 11+ messages in thread
From: Mika Westerberg @ 2013-07-03 18:04 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Ryan Mallon, Linux Kernel,
	hsweeten-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR,
	broonie-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Tue, Jul 02, 2013 at 10:08:21AM -0700, H Hartley Sweeten wrote:
> Use devm_clk_get() so that the clk_put() happens automatically when
> the last reference to this driver is dropped.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR@public.gmane.org>
> Cc: Ryan Mallon <rmallon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Mika Westerberg <mika.westerberg-X3B1VOXEql0@public.gmane.org>

Acked-by: Mika Westerberg <mika.westerberg-X3B1VOXEql0@public.gmane.org>

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
  2013-07-02 17:08 ` H Hartley Sweeten
  (?)
  (?)
@ 2013-07-03 18:21 ` Mark Brown
  2013-07-03 19:00     ` H Hartley Sweeten
  2013-07-03 21:12     ` H Hartley Sweeten
  -1 siblings, 2 replies; 11+ messages in thread
From: Mark Brown @ 2013-07-03 18:21 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: 346 bytes --]

On Tue, Jul 02, 2013 at 10:08:21AM -0700, H Hartley Sweeten wrote:
> Use devm_clk_get() so that the clk_put() happens automatically when
> the last reference to this driver is dropped.

This doesn't apply against current code - always submit against the
relevant development tree, in this case topic/ep93xx.  I've applied it
with a manual fixup.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
  2013-07-03 18:21 ` Mark Brown
@ 2013-07-03 19:00     ` H Hartley Sweeten
  2013-07-03 21:12     ` H Hartley Sweeten
  1 sibling, 0 replies; 11+ messages in thread
From: H Hartley Sweeten @ 2013-07-03 19:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
	grant.likely

On Wednesday, July 03, 2013 11:21 AM, Mark Brown wrote:
> On Tue, Jul 02, 2013 at 10:08:21AM -0700, H Hartley Sweeten wrote:
>> Use devm_clk_get() so that the clk_put() happens automatically when
>> the last reference to this driver is dropped.
>
> This doesn't apply against current code - always submit against the
> relevant development tree, in this case topic/ep93xx.  I've applied it
> with a manual fixup.

Sorry about the trouble. Thanks for fixing it.

Regards,
Hartley


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-03 19:00     ` H Hartley Sweeten
  0 siblings, 0 replies; 11+ messages in thread
From: H Hartley Sweeten @ 2013-07-03 19:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
	grant.likely

On Wednesday, July 03, 2013 11:21 AM, Mark Brown wrote:
> On Tue, Jul 02, 2013 at 10:08:21AM -0700, H Hartley Sweeten wrote:
>> Use devm_clk_get() so that the clk_put() happens automatically when
>> the last reference to this driver is dropped.
>
> This doesn't apply against current code - always submit against the
> relevant development tree, in this case topic/ep93xx.  I've applied it
> with a manual fixup.

Sorry about the trouble. Thanks for fixing it.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
  2013-07-03 18:21 ` Mark Brown
@ 2013-07-03 21:12     ` H Hartley Sweeten
  2013-07-03 21:12     ` H Hartley Sweeten
  1 sibling, 0 replies; 11+ messages in thread
From: H Hartley Sweeten @ 2013-07-03 21:12 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
	grant.likely

On Wednesday, July 03, 2013 11:21 AM, Mark Brown wrote:
> On Tue, Jul 02, 2013 at 10:08:21AM -0700, H Hartley Sweeten wrote:
>> Use devm_clk_get() so that the clk_put() happens automatically when
>> the last reference to this driver is dropped.
>
> This doesn't apply against current code - always submit against the
> relevant development tree, in this case topic/ep93xx.  I've applied it
> with a manual fixup.

Hello Mark,

It appears your topic/ep93xx branch is missing this:

commit 24778be20f87d5aadb19624fc768b3159fa43efc
Author: Stephen Warren <swarren@wwwdotorg.org>
Date:   Tue May 21 20:36:35 2013 -0600

    spi: convert drivers to use bits_per_word_mask

This commit is in linux-next which is what the patch series was based on.
I'm not sure what branch you applied that patch to.

If you need to drop my previous patches that you applied to topic/ep93xx
in order to sync things up please let me know how to proceed. There are
four more patches pending for spi-ep93xx to finish the cleanup and convert
it to the SPI queued driver infrastructure.

These are the relevant commits in topic/spi-ep93xx:

kernel / pub/scm/linux/kernel/git/broonie/spi / topic/ep93xx / drivers / spi / spi-ep93xx.c

3051c43  spi: spi-ep93xx: use devm_clk_get() by H Hartley Sweeten - 28 hours ago topic/ep93xx
e5ae625  spi: spi-ep93xx: remove 'dss' from per chip private data by H Hartley Sweeten - 28 hours ago
4af59ef  spi: spi-ep93xx: remove dev_err() for kzalloc() failure by H Hartley Sweeten - 28 hours ago
8b9d957  spi: spi-ep93xx: get platform resources early in (*probe) by H Hartley Sweeten - 28 hours ago
c6b7f14  spi: spi-ep93xx: remove bits_per_word() helper by H Hartley Sweeten - 28 hours ago
75c7444  spi: spi-ep93xx: use read,write instead of __raw_* variants by H Hartley Sweeten - 28 hours ago
eb41eeb  spi: spi-ep93xx: always handle transfer specific settings by H Hartley Sweeten - 5 days ago

Sorry about the trouble. I don't have your tree pulled so I was starting
from linux-next under the assumption that it was current to your tree.

Regards,
Hartley


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-03 21:12     ` H Hartley Sweeten
  0 siblings, 0 replies; 11+ messages in thread
From: H Hartley Sweeten @ 2013-07-03 21:12 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
	grant.likely

On Wednesday, July 03, 2013 11:21 AM, Mark Brown wrote:
> On Tue, Jul 02, 2013 at 10:08:21AM -0700, H Hartley Sweeten wrote:
>> Use devm_clk_get() so that the clk_put() happens automatically when
>> the last reference to this driver is dropped.
>
> This doesn't apply against current code - always submit against the
> relevant development tree, in this case topic/ep93xx.  I've applied it
> with a manual fixup.

Hello Mark,

It appears your topic/ep93xx branch is missing this:

commit 24778be20f87d5aadb19624fc768b3159fa43efc
Author: Stephen Warren <swarren@wwwdotorg.org>
Date:   Tue May 21 20:36:35 2013 -0600

    spi: convert drivers to use bits_per_word_mask

This commit is in linux-next which is what the patch series was based on.
I'm not sure what branch you applied that patch to.

If you need to drop my previous patches that you applied to topic/ep93xx
in order to sync things up please let me know how to proceed. There are
four more patches pending for spi-ep93xx to finish the cleanup and convert
it to the SPI queued driver infrastructure.

These are the relevant commits in topic/spi-ep93xx:

kernel / pub/scm/linux/kernel/git/broonie/spi / topic/ep93xx / drivers / spi / spi-ep93xx.c

3051c43  spi: spi-ep93xx: use devm_clk_get() by H Hartley Sweeten - 28 hours ago topic/ep93xx
e5ae625  spi: spi-ep93xx: remove 'dss' from per chip private data by H Hartley Sweeten - 28 hours ago
4af59ef  spi: spi-ep93xx: remove dev_err() for kzalloc() failure by H Hartley Sweeten - 28 hours ago
8b9d957  spi: spi-ep93xx: get platform resources early in (*probe) by H Hartley Sweeten - 28 hours ago
c6b7f14  spi: spi-ep93xx: remove bits_per_word() helper by H Hartley Sweeten - 28 hours ago
75c7444  spi: spi-ep93xx: use read,write instead of __raw_* variants by H Hartley Sweeten - 28 hours ago
eb41eeb  spi: spi-ep93xx: always handle transfer specific settings by H Hartley Sweeten - 5 days ago

Sorry about the trouble. I don't have your tree pulled so I was starting
from linux-next under the assumption that it was current to your tree.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
  2013-07-03 21:12     ` H Hartley Sweeten
@ 2013-07-03 22:51       ` Mark Brown
  -1 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2013-07-03 22:51 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
	grant.likely

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

On Wed, Jul 03, 2013 at 04:12:39PM -0500, H Hartley Sweeten wrote:

> This commit is in linux-next which is what the patch series was based on.
> I'm not sure what branch you applied that patch to.

I'll apply anything to topic/ep83xx branch.  Which I'll probably rebase
against spi-v3.11 now since Linus pulled the tree for the merge window.
The bits per word change was a cross subsystem thing so ended up on its
own topic branch.

> If you need to drop my previous patches that you applied to topic/ep93xx
> in order to sync things up please let me know how to proceed. There are
> four more patches pending for spi-ep93xx to finish the cleanup and convert
> it to the SPI queued driver infrastructure.

I'm waiting for others to review and/or test them since there seem to be
several interested people.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get()
@ 2013-07-03 22:51       ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2013-07-03 22:51 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, mika.westerberg,
	grant.likely

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

On Wed, Jul 03, 2013 at 04:12:39PM -0500, H Hartley Sweeten wrote:

> This commit is in linux-next which is what the patch series was based on.
> I'm not sure what branch you applied that patch to.

I'll apply anything to topic/ep83xx branch.  Which I'll probably rebase
against spi-v3.11 now since Linus pulled the tree for the merge window.
The bits per word change was a cross subsystem thing so ended up on its
own topic branch.

> If you need to drop my previous patches that you applied to topic/ep93xx
> in order to sync things up please let me know how to proceed. There are
> four more patches pending for spi-ep93xx to finish the cleanup and convert
> it to the SPI queued driver infrastructure.

I'm waiting for others to review and/or test them since there seem to be
several interested people.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-07-03 22:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02 17:08 [PATCH v2 05/11] spi: spi-ep93xx: use devm_clk_get() H Hartley Sweeten
2013-07-02 17:08 ` H Hartley Sweeten
2013-07-03 18:04 ` Mika Westerberg
2013-07-03 18:04   ` Mika Westerberg
2013-07-03 18:21 ` Mark Brown
2013-07-03 19:00   ` H Hartley Sweeten
2013-07-03 19:00     ` H Hartley Sweeten
2013-07-03 21:12   ` H Hartley Sweeten
2013-07-03 21:12     ` H Hartley Sweeten
2013-07-03 22:51     ` Mark Brown
2013-07-03 22:51       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.