From patchwork Tue May 11 09:37:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 98677 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4B9YQFY007399 for ; Tue, 11 May 2010 09:36:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757753Ab0EKJgB (ORCPT ); Tue, 11 May 2010 05:36:01 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:42126 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757745Ab0EKJgA (ORCPT ); Tue, 11 May 2010 05:36:00 -0400 Received: by pvb32 with SMTP id 32so437999pvb.19 for ; Tue, 11 May 2010 02:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=NNqsdBRVTKMWxYONnXn+C08ak7sK5Egpuh3Vvm0V3JY=; b=YlcOWBs/tNO+9TuTBAhTQhfcPTmp8JN24+hdGby7EqE0LA32V6rszRD9NDarcgx9TZ V21NU+B4wCaTmg/pe4OQ9TWm6RytrWfWTtEN1s650ATYWG9YofjLaXkiS4GgrnrIOBjd n6jhZ1PZd/Fm2pNbQyc9lTs53/v2NGodH5To8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=Lw7H6u85/FHwFlJEwEae1MwLmR7AhSIN5cka7N1ofKpgy4Ykml1bSRA+u6XD3BuhBm i2DiF+yzlEQEholwA3xLzr0FEUp1tJmoBOiHn0iHpvw1b4b+2lbreXni5FMKdCXLk5fg Jf3SfyrirJnHcWftVDfP+QXzaZ0m+C5vvtMxs= Received: by 10.115.113.5 with SMTP id q5mr4230739wam.67.1273570559225; Tue, 11 May 2010 02:35:59 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id c14sm33646838waa.13.2010.05.11.02.35.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 11 May 2010 02:35:58 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Tue, 11 May 2010 18:37:12 +0900 Message-Id: <20100511093712.28210.92591.sendpatchset@t400s> In-Reply-To: <20100511093504.28210.25670.sendpatchset@t400s> References: <20100511093504.28210.25670.sendpatchset@t400s> Subject: [PATCH 15/15] sh: remove unused clock lookup Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 11 May 2010 09:36:03 +0000 (UTC) --- 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);