linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dbaryshkov@gmail.com (Dmitry Eremin-Solenikov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] pcmcia: sa1111: make use of device clock
Date: Tue, 12 Nov 2013 07:32:12 +0400	[thread overview]
Message-ID: <1384227132-10501-5-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1384227132-10501-1-git-send-email-dbaryshkov@gmail.com>

Use per-device clock (instead of calling cpufreq_get(0), which can
return 0 if no cpu frequency driver is selected) to program timings.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/pcmcia/sa1111_generic.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 65b02c3..c5988be 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -145,6 +145,9 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
 			return -ENOMEM;
 
 		s->soc.nr = ops->first + i;
+		s->soc.clk = clk_get(&dev->dev, NULL);
+		if (IS_ERR(s->soc.clk))
+			return -ENODEV;
 		soc_pcmcia_init_one(&s->soc, ops, &dev->dev);
 		s->dev = dev;
 		if (s->soc.nr) {
@@ -220,6 +223,7 @@ static int pcmcia_remove(struct sa1111_dev *dev)
 	for (; s; s = next) {
 		next = s->next;
 		soc_pcmcia_remove_one(&s->soc);
+		clk_put(s->soc.clk);
 		kfree(s);
 	}
 
-- 
1.8.4.2

  parent reply	other threads:[~2013-11-12  3:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12  3:32 [PATCH 1/5] arm: sa1100: add cpu clock Dmitry Eremin-Solenikov
2013-11-12  3:32 ` [PATCH 2/5] fbdev: sa1100fb: make use of device clock Dmitry Eremin-Solenikov
2013-11-12  3:32 ` [PATCH 3/5] pcmcia: sa1100: " Dmitry Eremin-Solenikov
2013-11-12  3:32 ` [PATCH 4/5] arm: sa1100: add a clock alias for sa1111 pcmcia device Dmitry Eremin-Solenikov
2013-11-12 12:00   ` Dmitry Artamonow
2013-11-12  3:32 ` Dmitry Eremin-Solenikov [this message]
2013-11-12  9:57 ` [PATCH 1/5] arm: sa1100: add cpu clock Russell King - ARM Linux
2013-11-12 10:37   ` Dmitry Eremin-Solenikov

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=1384227132-10501-5-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --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).