From patchwork Fri Nov 13 10:58:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 56496 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp963714lbb; Fri, 13 Nov 2015 02:58:28 -0800 (PST) X-Received: by 10.68.132.97 with SMTP id ot1mr31261485pbb.162.1447412308033; Fri, 13 Nov 2015 02:58:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si26703633pbq.245.2015.11.13.02.58.27; Fri, 13 Nov 2015 02:58:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932858AbbKMK6Z (ORCPT + 28 others); Fri, 13 Nov 2015 05:58:25 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:34275 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbbKMK6V (ORCPT ); Fri, 13 Nov 2015 05:58:21 -0500 Received: by wmvv187 with SMTP id v187so75519418wmv.1 for ; Fri, 13 Nov 2015 02:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Ruxm0SQsn2Bnc/Lok9Ec453+ct/sjilyQvLTFHGpjW4=; b=t2er+7IN1TFkdHyQAJ39dYvBwjUSRZ4pGAYL6EZm0s7C/u8TABKxBoWV4QUZ/C8o5i ePMevVJ+rbZhUZ6zFoJMgVyoxY6dsN4p9BTYMjZQ8VN4P/DVDCnH5+GiA4utkPC+uOOY xzoBuzUxlqe9G8l+Vkp9HHvaSlfRHIisVcZnKU+5vhsBIc5Q8b6eUZchizNDeleScX0I kIAuzMMKFzxjE0Eg+HlVdJ3PBtZiUO4TZvVqmt+01Bi123F/qoai90/j+LsGum85cP8V chhkO4zn/64pWYUFSsSLZQ3gdJ4spYp18DcSrLyMIUXZI2rozQIvG/W/yd0IPOQ2Smfv FEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ruxm0SQsn2Bnc/Lok9Ec453+ct/sjilyQvLTFHGpjW4=; b=m5YHIghzCJ4oPOROYupxbl0Szmh0+l98EzYox3P368C5d9hG0a0ozsBrYnfrhWpQJH zmzPBApPmQZIa9kM8Mhx0lerhnYd3IHboRwc3DagZwgKE5AsdpK0x8Q1biSrTQw0mHlD SjbwuBdDsZ0BKfhLpMUcgxMUdMbUZOU+w2REDrJ3A+vdvyUL2lajiiSeB+gnSsZlKWeH 7hSDhoencHyjlbN8240K5vUd4fnubAUSkxfP1vW3FMk2R5OqlTvzTZ7CNwWOb35Vng9Y lnEfmBgSwjnRD2dNi2tf7w1UVJokgIncjeG6+LKfiYYnQFiJ5v0AivorTLzQUSSyqS+K sfwg== X-Gm-Message-State: ALoCoQnyNPonezZlwi1Lc2cgZzXComo5l5K1qWlpK9Y5nF3VA1ivDVoEEjs8oBqQv6K+DNnye9ue X-Received: by 10.28.211.143 with SMTP id k137mr3124092wmg.49.1447412300592; Fri, 13 Nov 2015 02:58:20 -0800 (PST) Received: from localhost.localdomain ([78.210.255.2]) by smtp.gmail.com with ESMTPSA id q1sm19284957wje.39.2015.11.13.02.58.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 02:58:19 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: marc_gonzalez@sigmadesigns.com, tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init Date: Fri, 13 Nov 2015 11:58:12 +0100 Message-Id: <1447412292-841-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current code to initialize, register and read the clocksource is already factored out in mmio.c via the clocksource_mmio_init function. Factor out the code with the clocksource_mmio_init function. Signed-off-by: Daniel Lezcano --- drivers/clocksource/tango_xtal.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/clocksource/tango_xtal.c b/drivers/clocksource/tango_xtal.c index d297b30..e756eea 100644 --- a/drivers/clocksource/tango_xtal.c +++ b/drivers/clocksource/tango_xtal.c @@ -19,19 +19,6 @@ static u64 notrace read_sched_clock(void) return read_xtal_counter(); } -static cycle_t read_clocksource(struct clocksource *cs) -{ - return read_xtal_counter(); -} - -static struct clocksource tango_xtal = { - .name = "tango-xtal", - .rating = 350, - .read = read_clocksource, - .mask = CLOCKSOURCE_MASK(32), - .flags = CLOCK_SOURCE_IS_CONTINUOUS, -}; - static void __init tango_clocksource_init(struct device_node *np) { struct clk *clk; @@ -53,8 +40,9 @@ static void __init tango_clocksource_init(struct device_node *np) delay_timer.freq = xtal_freq; delay_timer.read_current_timer = read_xtal_counter; - ret = clocksource_register_hz(&tango_xtal, xtal_freq); - if (ret != 0) { + ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350, + CLOCKSOURCE_MASK(32), clocksource_mmio_readl_up); + if (!ret) { pr_err("%s: registration failed\n", np->full_name); return; }