public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH 13/13] sh: Kill off clock lookup code
Date: Mon, 10 May 2010 11:24:59 +0000	[thread overview]
Message-ID: <20100510112459.14587.11878.sendpatchset@t400s> (raw)

From: Magnus Damm <damm@opensource.se>

Get rid of the SH-specific special clock lookup.
Also ditch the unused module ref counting code.
This syncs the behaviour with the ARM code.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/sh/include/asm/clock.h |    1 -
 arch/sh/kernel/cpu/clock.c  |   37 ++-----------------------------------
 2 files changed, 2 insertions(+), 36 deletions(-)

--- 0011/arch/sh/include/asm/clock.h
+++ work/arch/sh/include/asm/clock.h	2010-05-10 19:50:07.000000000 +0900
@@ -23,7 +23,6 @@ struct clk {
 	struct list_head	node;
 	const char		*name;
 	int			id;
-	struct module		*owner;
 
 	struct clk		*parent;
 	struct clk_ops		*ops;
--- 0006/arch/sh/kernel/cpu/clock.c
+++ work/arch/sh/kernel/cpu/clock.c	2010-05-10 19:49:41.000000000 +0900
@@ -398,49 +398,16 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
  * Returns a clock. Note that we first try to use device id on the bus
  * and clock name. If this fails, we try to use clock name only.
  */
-struct clk *clk_get(struct device *dev, const char *id)
+struct clk *clk_get(struct device *dev, const char *con_id)
 {
 	const char *dev_id = dev ? dev_name(dev) : NULL;
-	struct clk *p, *clk = ERR_PTR(-ENOENT);
-	int idno;
 
-	clk = clk_get_sys(dev_id, id);
-	if (clk && !IS_ERR(clk))
-		return clk;
-
-	if (dev = NULL || dev->bus != &platform_bus_type)
-		idno = -1;
-	else
-		idno = to_platform_device(dev)->id;
-
-	mutex_lock(&clock_list_sem);
-	list_for_each_entry(p, &clock_list, node) {
-		if (p->name && p->id = idno &&
-		    strcmp(id, p->name) = 0 && try_module_get(p->owner)) {
-			clk = p;
-			goto found;
-		}
-	}
-
-	list_for_each_entry(p, &clock_list, node) {
-		if (p->name &&
-		    strcmp(id, p->name) = 0 && try_module_get(p->owner)) {
-			clk = p;
-			break;
-		}
-	}
-
-found:
-	mutex_unlock(&clock_list_sem);
-
-	return clk;
+	return clk_get_sys(dev_id, con_id);
 }
 EXPORT_SYMBOL_GPL(clk_get);
 
 void clk_put(struct clk *clk)
 {
-	if (clk && !IS_ERR(clk))
-		module_put(clk->owner);
 }
 EXPORT_SYMBOL_GPL(clk_put);
 

                 reply	other threads:[~2010-05-10 11:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100510112459.14587.11878.sendpatchset@t400s \
    --to=magnus.damm@gmail.com \
    --cc=linux-sh@vger.kernel.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