From patchwork Tue Nov 12 03:32:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 3170581 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 475CB9F461 for ; Tue, 12 Nov 2013 03:32:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E65F20320 for ; Tue, 12 Nov 2013 03:32:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E1832039A for ; Tue, 12 Nov 2013 03:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751972Ab3KLDcd (ORCPT ); Mon, 11 Nov 2013 22:32:33 -0500 Received: from mail-we0-f179.google.com ([74.125.82.179]:47410 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194Ab3KLDcc (ORCPT ); Mon, 11 Nov 2013 22:32:32 -0500 Received: by mail-we0-f179.google.com with SMTP id x55so1471174wes.10 for ; Mon, 11 Nov 2013 19:32:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6Cz1B36OgjK8CnENCz+ePmX90dga9KfpJR/g6so0YZo=; b=SNbklEyaW1uYpGQgnUOTdvQ2COwKkDT774iOJiv4y6DP3VQG3R+qPPHsjCEZuNRIHS 6CVHndX6m7PSeo7tBFvIvv8A8OLT6gvrpJ+J8VZLx5ANcgdE716hFrqLlWAOaFYeNQYr 9R5m+z6PWmozBw4rjHznjl1wl5ZfvWiEEUXgJS/M80QE9QQ4T+Hlxxc2rxj3b+tP22lM NaUpTWqzJLEAoOupR68iEZ6QgAekxPim7AENSz8Pal9Swe0mgenmwnIQz9qAJaQizVpW CCxcOEQeWAuzwvSXqJsnf60FrLBmqLj07RxuFYdTSf7ZzfsPxz0XwH7bN5yf8H9uW5Nh gztw== X-Received: by 10.194.250.6 with SMTP id yy6mr25146553wjc.13.1384227150200; Mon, 11 Nov 2013 19:32:30 -0800 (PST) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id i8sm40087381wiy.6.2013.11.11.19.32.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2013 19:32:29 -0800 (PST) From: Dmitry Eremin-Solenikov To: linux-arm-kernel@lists.infradead.org Cc: linux-pcmcia@lists.infradead.org, linux-fbdev@vger.kernel.org, Russell King Subject: [PATCH 5/5] pcmcia: sa1111: make use of device clock Date: Tue, 12 Nov 2013 07:32:12 +0400 Message-Id: <1384227132-10501-5-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1384227132-10501-1-git-send-email-dbaryshkov@gmail.com> References: <1384227132-10501-1-git-send-email-dbaryshkov@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); }