From patchwork Tue Jul 17 11:24:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 142128 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3530667ljj; Tue, 17 Jul 2018 04:25:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdbrI2sf6O3EL5cOvXByjUk07BdRbl38VKdOM6uyvzSaeOl+VpUFNQe+eNi/Ln7pzgG1K60 X-Received: by 2002:a62:8d7:: with SMTP id 84-v6mr287920pfi.172.1531826714291; Tue, 17 Jul 2018 04:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826714; cv=none; d=google.com; s=arc-20160816; b=OliRfmVxZdj6IueYlQRIfZUxyQzFt+vKcocZLy3ugovxIicpZ5hDKTZo/CNJfv3fcZ LJzlgAM+XM/Pc+2cD9LnoCFiEk7Ach0/CXIq8r62bcMdsGt/qQhXiOyd81B02st83MXm 5w04muOmQbrmaMaA8BNFzHUXJ7vlxd093GbIsepgE/giDxxWrHNMhX41XgDPvavS3zFq 3uZU61dNZUwGwMsbzVzz9SPxzdNVYoffFIOslStqcayKp9jAoaA4+wBGooeqRm5ndh2g g437+uonidIwSJoQtp5bnzoQ0oP60JRJOxyo1OXbqO8WTInPwgZotkZ7psfhhoJ6m9sb sF/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=k3jKW0sCb0rK8PdrGlYTdRe+q05sdvywcfGkw5Lbutg=; b=NwwCAdysg1/rW7AIKhu93GdouH51dY1eN9JUU5MNMV5BIcQ5K1AMtT/eXMcOGU7r4D mPWcskhmgbmsUtkn3SBgEaxHtPWO/CN4c5K9AzNJRT2eIvTft3Rh8vrBhRXS9xwpgmH2 CXOdlSamB2PALVQGppaNhfChtIvUuufEPubLCkkNGdJWhJMP2j4Eno2o/IPHZfGtcRR3 mXs9QHIE8pIACZ3Kte/B6Wg8TLM/DiM9fG2HNSGQmiwYzH8SrKGHhIx1VOlSl6SWwfxo 4ygnvXwaCFkyiF1buvJTXdzBn2AwqGWvvMfAy/YtI0xLZjU4PrUSNZAYMBo3hzXRdD+z SCQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HgbzAvea; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si632181pgd.448.2018.07.17.04.25.14; Tue, 17 Jul 2018 04:25:14 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=HgbzAvea; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731300AbeGQL5V (ORCPT + 31 others); Tue, 17 Jul 2018 07:57:21 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34822 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730638AbeGQL5V (ORCPT ); Tue, 17 Jul 2018 07:57:21 -0400 Received: by mail-pg1-f196.google.com with SMTP id e6-v6so319544pgv.2 for ; Tue, 17 Jul 2018 04:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=k3jKW0sCb0rK8PdrGlYTdRe+q05sdvywcfGkw5Lbutg=; b=HgbzAveaSKoFkhJeJuYv38MCDkH8abJSq1TpKAP4jPut74BL6aFBLoUrAGAEnrO2cY nMxgwjwlMS3EPjDNLUHnyoCJpECeH4DrJx7MNdyKg9A80OqkcmjRrGPGHw5vhXxvXeCm 3yAgPIp3dBD4Wk1ehWJNSr6GmoJx47zF79w78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k3jKW0sCb0rK8PdrGlYTdRe+q05sdvywcfGkw5Lbutg=; b=IIDue6x/GLvMwPy2sen+1nG31o55Rt9sMlcYnCPMGKY/xug+5VBAIGmtZ9aRHdqlCJ Hy1OtEYJUt91oXDgdfXjQ1IiXUe3FG43VvYLRNQvVVoS0yKLcNMEkvb/rTLOWcY9xcK+ wKjEy6fa848G2PpWCRuzWglm8SMV5DcxhGg24zs41kz9QHuAClaBmU/mXXojzxhN3QuO 4ZAYMs6m0H/d2GayvmAPewajjMA7WlfbOSSgvdhifHDPiEiMEqI+JO4lUYQFLQnNuZUk u/bz98t/AqDxNCixrCXuznshJB5Rv67L5muZiqNE+QHn4S0UZhmAmckJQFrAyWYXTAW7 lY0g== X-Gm-Message-State: AOUpUlFEsk9ZwJWmEvQkEJFaYB/9I3AknvwYlh9WmZbzZm4xNN85kN0o MJJpKkmclqDSn7F4ejPHHDQ8Pw== X-Received: by 2002:a63:c80e:: with SMTP id z14-v6mr1172426pgg.77.1531826710885; Tue, 17 Jul 2018 04:25:10 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id y3-v6sm1391207pge.29.2018.07.17.04.25.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 04:25:10 -0700 (PDT) From: Baolin Wang To: ysato@users.sourceforge.jp, dalias@libc.org, corbet@lwn.net Cc: baolin.wang@linaro.org, arnd@arndb.de, broonie@kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 1/4] sh: dreamcast: rtc: push down rtc class ops into driver Date: Tue, 17 Jul 2018 19:24:24 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The dreamcast RTC support has an extra level of indirection to provide either the old read_persistent_clock/update_persistent_clock interface or the rtc-generic device for hctosys/systohc. Both do the same thing here, so we can do away with the abstraction and simply enable the RTC core code to take care of it. Signed-off-by: Arnd Bergmann Signed-off-by: Baolin Wang --- arch/sh/boards/mach-dreamcast/Makefile | 4 +-- arch/sh/boards/mach-dreamcast/rtc.c | 39 +++++++++++++++++-------- arch/sh/boards/mach-dreamcast/setup.c | 1 - arch/sh/configs/dreamcast_defconfig | 2 ++ arch/sh/include/mach-dreamcast/mach/sysasic.h | 1 - 5 files changed, 31 insertions(+), 16 deletions(-) -- 1.7.9.5 diff --git a/arch/sh/boards/mach-dreamcast/Makefile b/arch/sh/boards/mach-dreamcast/Makefile index 7b97546..62b024b 100644 --- a/arch/sh/boards/mach-dreamcast/Makefile +++ b/arch/sh/boards/mach-dreamcast/Makefile @@ -2,5 +2,5 @@ # Makefile for the Sega Dreamcast specific parts of the kernel # -obj-y := setup.o irq.o rtc.o - +obj-y := setup.o irq.o +obj-$(CONFIG_RTC_DRV_GENERIC) += rtc.o diff --git a/arch/sh/boards/mach-dreamcast/rtc.c b/arch/sh/boards/mach-dreamcast/rtc.c index 061d657..4f168d8 100644 --- a/arch/sh/boards/mach-dreamcast/rtc.c +++ b/arch/sh/boards/mach-dreamcast/rtc.c @@ -11,8 +11,9 @@ */ #include -#include -#include +#include +#include +#include /* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in seconds) to get the standard Unix Epoch when getting the time, and add @@ -30,9 +31,10 @@ * * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch. */ -static void aica_rtc_gettimeofday(struct timespec *ts) +static int aica_rtc_gettimeofday(struct device *dev, struct rtc_time *tm) { unsigned long val1, val2; + time64_t t; do { val1 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) | @@ -42,10 +44,12 @@ static void aica_rtc_gettimeofday(struct timespec *ts) (__raw_readl(AICA_RTC_SECS_L) & 0xffff); } while (val1 != val2); - ts->tv_sec = val1 - TWENTY_YEARS; + /* normalize to 1970..2106 time range */ + t = (u32)(val1 - TWENTY_YEARS); - /* Can't get nanoseconds with just a seconds counter. */ - ts->tv_nsec = 0; + rtc_time64_to_tm(t, tm); + + return 0; } /** @@ -54,10 +58,11 @@ static void aica_rtc_gettimeofday(struct timespec *ts) * * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter. */ -static int aica_rtc_settimeofday(const time_t secs) +static int aica_rtc_settimeofday(struct device *dev, struct rtc_time *tm) { unsigned long val1, val2; - unsigned long adj = secs + TWENTY_YEARS; + time64_t secs = rtc_tm_to_time64(tm); + u32 adj = secs + TWENTY_YEARS; do { __raw_writel((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H); @@ -73,9 +78,19 @@ static int aica_rtc_settimeofday(const time_t secs) return 0; } -void aica_time_init(void) +static const struct rtc_class_ops rtc_generic_ops = { + .read_time = aica_rtc_gettimeofday, + .set_time = aica_rtc_settimeofday, +}; + +static int __init aica_time_init(void) { - rtc_sh_get_time = aica_rtc_gettimeofday; - rtc_sh_set_time = aica_rtc_settimeofday; -} + struct platform_device *pdev; + + pdev = platform_device_register_data(NULL, "rtc-generic", -1, + &rtc_generic_ops, + sizeof(rtc_generic_ops)); + return PTR_ERR_OR_ZERO(pdev); +} +arch_initcall(aica_time_init); diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c index ad1a4db..672c2ad8 100644 --- a/arch/sh/boards/mach-dreamcast/setup.c +++ b/arch/sh/boards/mach-dreamcast/setup.c @@ -30,7 +30,6 @@ static void __init dreamcast_setup(char **cmdline_p) { - board_time_init = aica_time_init; } static struct sh_machine_vector mv_dreamcast __initmv = { diff --git a/arch/sh/configs/dreamcast_defconfig b/arch/sh/configs/dreamcast_defconfig index 3f08dc5..1d27666 100644 --- a/arch/sh/configs/dreamcast_defconfig +++ b/arch/sh/configs/dreamcast_defconfig @@ -70,3 +70,5 @@ CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_HUGETLBFS=y # CONFIG_CRYPTO_ANSI_CPRNG is not set +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_GENERIC=y diff --git a/arch/sh/include/mach-dreamcast/mach/sysasic.h b/arch/sh/include/mach-dreamcast/mach/sysasic.h index 58f710e..59effd1 100644 --- a/arch/sh/include/mach-dreamcast/mach/sysasic.h +++ b/arch/sh/include/mach-dreamcast/mach/sysasic.h @@ -42,7 +42,6 @@ /* arch/sh/boards/mach-dreamcast/irq.c */ extern int systemasic_irq_demux(int); extern void systemasic_irq_init(void); -extern void aica_time_init(void); #endif /* __ASM_SH_DREAMCAST_SYSASIC_H */ From patchwork Tue Jul 17 11:24:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 142129 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3530729ljj; Tue, 17 Jul 2018 04:25:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfymFPLefyLXr1s3UPlxAveEC/4ge5uAgH8hx37gfiXv1/UGJ5ifXghCvaU+G2K7DbSuV8J X-Received: by 2002:a63:67c3:: with SMTP id b186-v6mr1222005pgc.5.1531826717813; Tue, 17 Jul 2018 04:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826717; cv=none; d=google.com; s=arc-20160816; b=oLnhCaCXojiq/vEaHOTk7ZTreghG+MbBfFEukfhQcCyA90D4huWzr9b25bo/p0hniI Z09TehmYCKx0KsA7VqOzcMSDSO0kYvk3z4TjBfxmoAaOOGti64iT7JlBxPlr+LM8evpZ NOY4MhtZ98y09r4+s8p5Pon52EEKEamkUWFXkjzSL52fNxVj5uNZ9y/MUesuvTTTyvHa x70i8cwYxb9o9UEeLlP3+AM0PCBn9uVOkS6BeCeVije4y6yu1wXDsJrrpnd+OYEpnKZr nf38ThFT4PFfXLMoq3ZiyttYa9rD+jCdTQi8TQshYJwkf6xgbmrb5EWDFCEnrVqV7Br7 KrFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=PTtFId+Y0EEs5+cllmvrMc/Z4BBjEeLBQmZE8Amw2Fs=; b=QrbeuxDlGDydV5uEpWc0AGh4OSlANcrKJQojU5guGkcUq+dXfiy25mTbzwWp/+UfR6 KkO5kvIUCW+Myq/TRqCqO56/fzSXAPIjQUkepVZ91SESBf6Vu6xUMbHYhffowlcw1c6j THnLyDjJ+NKksjYjpFSdv50RmDuEWzhPDRJI9UxIwHPanNlVMWOsMbHrUG8t8MVHeKXQ 6IOcaOPsKVRAYYzGwjsdaxFoiSW9eyWM2mnyU0P5VMDsYZGueT4u1bdx8ykp4R4XYdKh RgcTcfvEjJ453Yb580Blwne1cGrkNFs7iTfUCjEXObLwlRWkOoSzsSLiTo/SQNf9j97q YJUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JOZmj5tu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8-v6si745573pgs.324.2018.07.17.04.25.17; Tue, 17 Jul 2018 04:25:17 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=JOZmj5tu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731431AbeGQL5Z (ORCPT + 31 others); Tue, 17 Jul 2018 07:57:25 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36066 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731256AbeGQL5Y (ORCPT ); Tue, 17 Jul 2018 07:57:24 -0400 Received: by mail-pf0-f196.google.com with SMTP id d14-v6so365959pfo.3 for ; Tue, 17 Jul 2018 04:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=PTtFId+Y0EEs5+cllmvrMc/Z4BBjEeLBQmZE8Amw2Fs=; b=JOZmj5tuLw2cxLCnpI93zZTUwIZv+Z6685Ga82IC6HSk74uIe9xTOqwuzOyXsLSjou fsmqRX7gwVUtXjilC31ujon5hxjxqfgB2ixE9ovqN0eT30OQPGbs1Fkgq35QPrRq4bJH TpSOMbdHUxnKMGuMWbEN7UnGEGRSCyN2EVND0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=PTtFId+Y0EEs5+cllmvrMc/Z4BBjEeLBQmZE8Amw2Fs=; b=s45kG2OP69UDic/H6eOVX+GNV3mQTW3Jv8MBzb1GJA0lFAVtbOwPT0kDyEMd8kxLQf abQijsMU99M70KjGtJbxb09GDNjeBhpmMSFeRxX88pzZ+8ZxgBHkXFpJvgcl8lQrdMJW oWLFEDfO/+kRhqw6G68eAGwN7f+KWEQ7RqrJFdRQ44txSGe1i3OrJ7Jm9qg+z3JtcUdU caWYa1SRbLSC/W+qEBUAsT5dwRpQKT80lEBBcLdVrIIGORUObZjfBatahMoog4A0ygRe hT86Vu7fwnG0EoDP8CMeEsEpZATT3bIthxYnrJnPAYd9EEAbKAxzgpoZJ0CriLGEvwrD fIeA== X-Gm-Message-State: AOUpUlGzKI2eZXS8Jy6z0v+bmk44xxwX/nSec3xCYSmXIe3i9w3DweM8 d2s/09rjSfxavtYyQPBBOQK9XQ== X-Received: by 2002:a65:614a:: with SMTP id o10-v6mr1151025pgv.387.1531826713954; Tue, 17 Jul 2018 04:25:13 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id y3-v6sm1391207pge.29.2018.07.17.04.25.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 04:25:13 -0700 (PDT) From: Baolin Wang To: ysato@users.sourceforge.jp, dalias@libc.org, corbet@lwn.net Cc: baolin.wang@linaro.org, arnd@arndb.de, broonie@kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 2/4] sh: sh03: rtc: push down rtc class ops into driver Date: Tue, 17 Jul 2018 19:24:25 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The dreamcast RTC support has an extra level of indirection to provide either the old read_persistent_clock/update_persistent_clock interface or the rtc-generic device for hctosys/systohc. By removing the indirection and always using the RTC_CLASS interface, we can avoid the lossy double conversion between rtc_time and timespec, so we end up supporting the entire range of 'year' values, and clarifying the rtc_set_time callback. I did not change the behavior of sh03_rtc_settimeofday(), which keeps just updating the seconds/minutes by calling set_rtc_mmss(), this could be improved if anyone cares. Also, the file should ideally be moved into drivers/rtc and not use rtc-generic. Signed-off-by: Arnd Bergmann Signed-off-by: Baolin Wang --- arch/sh/boards/mach-sh03/Makefile | 3 ++- arch/sh/boards/mach-sh03/rtc.c | 51 ++++++++++++++++++++++--------------- arch/sh/boards/mach-sh03/setup.c | 9 ------- arch/sh/configs/sh03_defconfig | 2 ++ 4 files changed, 35 insertions(+), 30 deletions(-) -- 1.7.9.5 diff --git a/arch/sh/boards/mach-sh03/Makefile b/arch/sh/boards/mach-sh03/Makefile index 400306a..47007a3 100644 --- a/arch/sh/boards/mach-sh03/Makefile +++ b/arch/sh/boards/mach-sh03/Makefile @@ -2,4 +2,5 @@ # Makefile for the Interface (CTP/PCI-SH03) specific parts of the kernel # -obj-y := setup.o rtc.o +obj-y := setup.o +obj-$(CONFIG_RTC_DRV_GENERIC) += rtc.o diff --git a/arch/sh/boards/mach-sh03/rtc.c b/arch/sh/boards/mach-sh03/rtc.c index dc3d50e..8b23ed7 100644 --- a/arch/sh/boards/mach-sh03/rtc.c +++ b/arch/sh/boards/mach-sh03/rtc.c @@ -13,8 +13,9 @@ #include #include #include -#include -#include +#include +#include +#include #define RTC_BASE 0xb0000000 #define RTC_SEC1 (RTC_BASE + 0) @@ -38,7 +39,7 @@ static DEFINE_SPINLOCK(sh03_rtc_lock); -unsigned long get_cmos_time(void) +static int sh03_rtc_gettimeofday(struct device *dev, struct rtc_time *tm) { unsigned int year, mon, day, hour, min, sec; @@ -75,17 +76,18 @@ unsigned long get_cmos_time(void) } spin_unlock(&sh03_rtc_lock); - return mktime(year, mon, day, hour, min, sec); -} -void sh03_rtc_gettimeofday(struct timespec *tv) -{ + tm->tm_sec = sec; + tm->tm_min = min; + tm->tm_hour = hour; + tm->tm_mday = day; + tm->tm_mon = mon; + tm->tm_year = year - 1900; - tv->tv_sec = get_cmos_time(); - tv->tv_nsec = 0; + return 0; } -static int set_rtc_mmss(unsigned long nowtime) +static int set_rtc_mmss(struct rtc_time *tm) { int retval = 0; int real_seconds, real_minutes, cmos_minutes; @@ -97,8 +99,8 @@ static int set_rtc_mmss(unsigned long nowtime) if (!(__raw_readb(RTC_CTL) & RTC_BUSY)) break; cmos_minutes = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10; - real_seconds = nowtime % 60; - real_minutes = nowtime / 60; + real_seconds = tm->tm_sec; + real_minutes = tm->tm_min; if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) real_minutes += 30; /* correct for half hour time zone */ real_minutes %= 60; @@ -112,22 +114,31 @@ static int set_rtc_mmss(unsigned long nowtime) printk_once(KERN_NOTICE "set_rtc_mmss: can't update from %d to %d\n", cmos_minutes, real_minutes); - retval = -1; + retval = -EINVAL; } spin_unlock(&sh03_rtc_lock); return retval; } -int sh03_rtc_settimeofday(const time_t secs) +int sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm) { - unsigned long nowtime = secs; - - return set_rtc_mmss(nowtime); + return set_rtc_mmss(tm); } -void sh03_time_init(void) +static const struct rtc_class_ops rtc_generic_ops = { + .read_time = sh03_rtc_gettimeofday, + .set_time = sh03_rtc_settimeofday, +}; + +static int __init sh03_time_init(void) { - rtc_sh_get_time = sh03_rtc_gettimeofday; - rtc_sh_set_time = sh03_rtc_settimeofday; + struct platform_device *pdev; + + pdev = platform_device_register_data(NULL, "rtc-generic", -1, + &rtc_generic_ops, + sizeof(rtc_generic_ops)); + + return PTR_ERR_OR_ZERO(pdev); } +arch_initcall(sh03_time_init); diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c index 85e7059..3901b60 100644 --- a/arch/sh/boards/mach-sh03/setup.c +++ b/arch/sh/boards/mach-sh03/setup.c @@ -22,14 +22,6 @@ static void __init init_sh03_IRQ(void) plat_irq_setup_pins(IRQ_MODE_IRQ); } -/* arch/sh/boards/sh03/rtc.c */ -void sh03_time_init(void); - -static void __init sh03_setup(char **cmdline_p) -{ - board_time_init = sh03_time_init; -} - static struct resource cf_ide_resources[] = { [0] = { .start = 0x1f0, @@ -101,6 +93,5 @@ static int __init sh03_devices_setup(void) static struct sh_machine_vector mv_sh03 __initmv = { .mv_name = "Interface (CTP/PCI-SH03)", - .mv_setup = sh03_setup, .mv_init_irq = init_sh03_IRQ, }; diff --git a/arch/sh/configs/sh03_defconfig b/arch/sh/configs/sh03_defconfig index 2156223..489ffdf 100644 --- a/arch/sh/configs/sh03_defconfig +++ b/arch/sh/configs/sh03_defconfig @@ -130,3 +130,5 @@ CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_DEFLATE=y # CONFIG_CRYPTO_ANSI_CPRNG is not set CONFIG_CRC_CCITT=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_GENERIC=y From patchwork Tue Jul 17 11:24:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 142130 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3530775ljj; Tue, 17 Jul 2018 04:25:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqU3dItJLbEqZaV85My39F0304h13cQjSEbSqivKvLSJDPsPakpOVWO4kbjCikyWyGG29Y X-Received: by 2002:a17:902:7202:: with SMTP id ba2-v6mr1222385plb.179.1531826720645; Tue, 17 Jul 2018 04:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826720; cv=none; d=google.com; s=arc-20160816; b=j4qe09PIFAGR1xGhcSwlZqXxJ6gP6cBv4eWKu6xvOriiiTaxIN/15QbOItLhbRwLYs Q8cs7hg8I5zJ9JjLUQzd/kEKMCfOghmw2GI0phd4dvwcx4x8oHElvGHR8y3Wb07E9CKu XUcwwsk1u5wv3e1sDbz8HXKNVO2UTlR3+TxkMMgoIy0PjUPtR1O9nL48Zu0cznfxU2i0 O25e633Rv0pwBddhjxJBEjCE2BozjYkirqJD3ErK0+XbiyBNbSNyh3Ld/459pkE72MpC 3gyuyZ6hriK2mBcphE3fVKMuI3WNrT3zqQ04zhFBM3FkMJIRoDmWfCh78xxV1nu/ScNn zpxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=h5pyTBJ057uXRLaH+mRr4AZ+5BautkbuTr1+Xl62gvQ=; b=Q/UKExpt8scMeE9Vz7VwQBJ2nu8EP51rNxiXOLqHibqfQ8TPnyOfSEUVf0uHUSAFqB 8/hbwTAk8lXUvS4rNA2iSHawpXRi1M8UNRUWGJ0x4+l7JfT63twOY9mcOSH23SqOy3DS JwkPBjZSv0gx5aN32XEkSHtvIM13gPQbzAsY1ZbJ7jmYm7avhM+zTkN/yMGmOilH782O t6BXmvku6Gn5jYPW0FH8pyp9Nzk72t1/m1NlaeEtTNLQ5Dxot1Or9+0QMFJLYU93IZ58 DP2ZcB7M3lXo+NbAcMEp4SIDK9ymUlKpr0ljxUZorVt6coza1RCmpT+GKT85ywYII6Zt acJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BGvWeulj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si636634pls.347.2018.07.17.04.25.20; Tue, 17 Jul 2018 04:25:20 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=BGvWeulj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731497AbeGQL52 (ORCPT + 31 others); Tue, 17 Jul 2018 07:57:28 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41398 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731194AbeGQL51 (ORCPT ); Tue, 17 Jul 2018 07:57:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id z8-v6so311343pgu.8 for ; Tue, 17 Jul 2018 04:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=h5pyTBJ057uXRLaH+mRr4AZ+5BautkbuTr1+Xl62gvQ=; b=BGvWeuljeongoABnA5xSmIk38nlKLK/kumQ2OXXnH6PothQvKj5Ov9wKXqBUx1yw5C P21E/0H8ri+8CrvYPFjmbBC0r5K0BRMqi5iYxdp7ad8RR1ixq1kymhdeTT7QE+U+v+6y 5GFiO6AfosnoEC2veisRX7kST2pGKkxsPOIKE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=h5pyTBJ057uXRLaH+mRr4AZ+5BautkbuTr1+Xl62gvQ=; b=SMZq2eueXjRYdw+CdXwUl0APEjC0V34IQgCBbdmg0oIbEIJkK9ViPdjE2oSVsgDf59 iHFS67aqhOkcqtLgy6nilhY9BVL8FgYe9mFZuMpU+kNw2vlA/5UEzeEChssWGLk4epgd aSY66CMbVnmHEIZDv9hEijIs74vo2w6zwqJBA+m00vXXuVkK0g2DchEy6+13jqU1kwyz 2YLySDN4Eq4mP/ko2Pn5Fz7FuHgqqPc0erSGMI63TFFQoOnW6gNZm8N4WTP1e/+WZKhC o64QqdTIlEvmMVTUhypV3xyMNqsDUAS1vA+Ju1S1OanKzs7uAc01300WGa0hcp2I4Og/ YlOg== X-Gm-Message-State: AOUpUlHXy9ToK35+HK78PjWEIzamT5EsbEjBJ+tj49fG0FLHUQkdlHeV Kq77yKX69NCwVDYYzKGpWkDP2Q== X-Received: by 2002:a65:6258:: with SMTP id q24-v6mr1193561pgv.131.1531826716845; Tue, 17 Jul 2018 04:25:16 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id y3-v6sm1391207pge.29.2018.07.17.04.25.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 04:25:16 -0700 (PDT) From: Baolin Wang To: ysato@users.sourceforge.jp, dalias@libc.org, corbet@lwn.net Cc: baolin.wang@linaro.org, arnd@arndb.de, broonie@kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 3/4] sh: remove unused rtc_sh_get/set_time infrastructure Date: Tue, 17 Jul 2018 19:24:26 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann All platforms are now converted to RTC drivers, so this has become obsolete. The board_time_init() callback still has one caller, but could otherwise also get killed. This removes one more usage of the deprecated timespec structure, which overflows in y2038. Signed-off-by: Arnd Bergmann Signed-off-by: Baolin Wang --- arch/sh/include/asm/rtc.h | 2 -- arch/sh/kernel/time.c | 69 --------------------------------------------- 2 files changed, 71 deletions(-) -- 1.7.9.5 diff --git a/arch/sh/include/asm/rtc.h b/arch/sh/include/asm/rtc.h index c63555e..fe55fbb 100644 --- a/arch/sh/include/asm/rtc.h +++ b/arch/sh/include/asm/rtc.h @@ -4,8 +4,6 @@ void time_init(void); extern void (*board_time_init)(void); -extern void (*rtc_sh_get_time)(struct timespec *); -extern int (*rtc_sh_set_time)(const time_t); #define RTC_CAP_4_DIGIT_YEAR (1 << 0) diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index fcd5e41..eb0a912 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -22,75 +22,6 @@ #include #include -/* Dummy RTC ops */ -static void null_rtc_get_time(struct timespec *tv) -{ - tv->tv_sec = mktime(2000, 1, 1, 0, 0, 0); - tv->tv_nsec = 0; -} - -static int null_rtc_set_time(const time_t secs) -{ - return 0; -} - -void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; -int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; - -void read_persistent_clock(struct timespec *ts) -{ - rtc_sh_get_time(ts); -} - -#ifdef CONFIG_GENERIC_CMOS_UPDATE -int update_persistent_clock(struct timespec now) -{ - return rtc_sh_set_time(now.tv_sec); -} -#endif - -static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm) -{ - struct timespec tv; - - rtc_sh_get_time(&tv); - rtc_time_to_tm(tv.tv_sec, tm); - return 0; -} - -static int rtc_generic_set_time(struct device *dev, struct rtc_time *tm) -{ - unsigned long secs; - - rtc_tm_to_time(tm, &secs); - if ((rtc_sh_set_time == null_rtc_set_time) || - (rtc_sh_set_time(secs) < 0)) - return -EOPNOTSUPP; - - return 0; -} - -static const struct rtc_class_ops rtc_generic_ops = { - .read_time = rtc_generic_get_time, - .set_time = rtc_generic_set_time, -}; - -static int __init rtc_generic_init(void) -{ - struct platform_device *pdev; - - if (rtc_sh_get_time == null_rtc_get_time) - return -ENODEV; - - pdev = platform_device_register_data(NULL, "rtc-generic", -1, - &rtc_generic_ops, - sizeof(rtc_generic_ops)); - - - return PTR_ERR_OR_ZERO(pdev); -} -device_initcall(rtc_generic_init); - void (*board_time_init)(void); static void __init sh_late_time_init(void) From patchwork Tue Jul 17 11:24:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 142131 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3530849ljj; Tue, 17 Jul 2018 04:25:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcWC2KilubUqdnHfluUJIlJlIlEbvF/6MbxK5KR7ILW668SChSORbnEBvN2SX/BufDTk+Db X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr1217798plo.281.1531826724499; Tue, 17 Jul 2018 04:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826724; cv=none; d=google.com; s=arc-20160816; b=ZwhIGMDrWeXcw3k/gfpN/Io4Tt9E1NzimjPrlasb4iStfabpVD8UZQatnvw2Gd1UzM kZHj+ZtytQx8cWimya0iJSyrEnudUAg2STOw3vnj+0AunbcgE9JLOzWcjOQNW8G0dYpn p2iXCFwfwv53N+i6ADXLYxWVXSj6kIQQ4G7cye5RaB+X3dElHOB7EFglDgk5KajQiMN6 iXEDPYJbIvjGxXPK9CLrYynjOufjWR2laT8pOkx0uKPdcAoldTz+0oxDsXkFQ5H9CiOo uONz6+YDpJnRsLsxnxDjgiDeY6LhPjLn6nd0b/7oXsfDpzRMnIbKSfpSQZVCDxOnSspM w0iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=f95cnvAKHz2LDIUfrbxH7/UwasS/e/nMiJeOdptmf04=; b=DrFafTj3z1rccZr6qhvWnjVdyUYnIo8BGH2/sGK82+ft+T42d7M+BwxSGL+AexOl4L w+2zZ6jwP55ugPSEJtUM7NcciMx70lK2ZM0i4hs9rtX/3gVm41excXxi0dNzPyV9pzJd sTIPqqKPsv7g7GvxtRPD3xvla0Uh3iBSUcKR7wqP8AGlTkIv2zJ77paKdqwrlaxHxEJ1 HyT7ey8KT98WjWMqE+Ro6am7xwhyOU84+aF2rLPUjsqfxronz4Kwju62JPg/GNeeq/Su C4VkTWX0bzbcDROnJi5QmrBbJTHz1s7PgLC/A7Ysl+cZuVbPmQfQYFT8rSIENi5T85RF YoWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BFIqFaV7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5-v6si692500plk.406.2018.07.17.04.25.24; Tue, 17 Jul 2018 04:25:24 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=BFIqFaV7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731584AbeGQL5b (ORCPT + 31 others); Tue, 17 Jul 2018 07:57:31 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44539 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731256AbeGQL5a (ORCPT ); Tue, 17 Jul 2018 07:57:30 -0400 Received: by mail-pg1-f195.google.com with SMTP id r1-v6so307831pgp.11 for ; Tue, 17 Jul 2018 04:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=f95cnvAKHz2LDIUfrbxH7/UwasS/e/nMiJeOdptmf04=; b=BFIqFaV7DoWqeGOMnrMJXE8GnLVNDr/wPRbqwAHtK8nHBHWSuElEfL/YcTQQ0hEcfM l6j5XOBTxvron0FHINhiXFfd4sgyih9dWceJ+IW21X7auqAucGp9MftF7i78tXkV+M/e h76XQ8OD4Ox1Xayt1TA7h1eNjAU28DeWKAJFM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=f95cnvAKHz2LDIUfrbxH7/UwasS/e/nMiJeOdptmf04=; b=pv+557pyWuUF3hM14FP2R23Fcq6a+nxdYPXt0xOg74pX8SREDGWWYy90ahqYYcVX1D HWBR19pXsi90o89IOp9/oA47l2C6vW4GE3iaBfFxm+iQPuVfKxScNOnR6kS38ej2dOkx G/l64fuH2jkySOBcreoYg1RnHVB/z6gUr5da04SWrdGhwhTRAIdP53wDDcAeZih54Vdq C4Skbi2aNOABcLlD5eC607Ws05mKzK5VeRojSEl4UKQxXpYOddGgJ/KCjQqDYWy6GZuy QWdVEIJOJtGs2J9ARVgWbvEqE4YeZfTXW4VSBKaRhLzTo736ASjitwoV70I7gO84b07s qKzg== X-Gm-Message-State: AOUpUlGk6eZJC2tiRk0QT6BE5ie/8Kb02FE108TS1y7MQlVZU6kkTVCd mTOlwY+je215h6kd0zY0RiLXiA== X-Received: by 2002:a63:8848:: with SMTP id l69-v6mr1161273pgd.377.1531826719616; Tue, 17 Jul 2018 04:25:19 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id y3-v6sm1391207pge.29.2018.07.17.04.25.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 04:25:19 -0700 (PDT) From: Baolin Wang To: ysato@users.sourceforge.jp, dalias@libc.org, corbet@lwn.net Cc: baolin.wang@linaro.org, arnd@arndb.de, broonie@kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 4/4] sh: remove board_time_init() callback Date: Tue, 17 Jul 2018 19:24:27 +0800 Message-Id: <0ad306a7d410d3695c7869bf081efaa71e956ae4.1531826106.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The only remaining user of board_time_init() is the of-generic machine, and that just calls the global timer_init() function. Calling that one has no effect on non-DT platforms, so we can simply call it unconditionally in place of board_time_init(). Signed-off-by: Arnd Bergmann Signed-off-by: Baolin Wang --- Documentation/sh/new-machine.txt | 8 -------- arch/sh/boards/of-generic.c | 8 -------- arch/sh/include/asm/rtc.h | 1 - arch/sh/kernel/time.c | 5 +---- 4 files changed, 1 insertion(+), 21 deletions(-) -- 1.7.9.5 diff --git a/Documentation/sh/new-machine.txt b/Documentation/sh/new-machine.txt index f035416..e0961a66 100644 --- a/Documentation/sh/new-machine.txt +++ b/Documentation/sh/new-machine.txt @@ -116,7 +116,6 @@ might look something like: * arch/sh/boards/vapor/setup.c - Setup code for imaginary board */ #include -#include /* for board_time_init() */ const char *get_system_type(void) { @@ -132,13 +131,6 @@ int __init platform_setup(void) * this board. */ - /* - * Presume all FooTech boards have the same broken timer, - * and also presume that we've defined foo_timer_init to - * do something useful. - */ - board_time_init = foo_timer_init; - /* Start-up imaginary PCI ... */ /* And whatever else ... */ diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 46b2481..ee74ff1 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -116,18 +116,10 @@ static void __init sh_of_mem_reserve(void) early_init_fdt_scan_reserved_mem(); } -static void __init sh_of_time_init(void) -{ - pr_info("SH generic board support: scanning for clocksource devices\n"); - timer_probe(); -} - static void __init sh_of_setup(char **cmdline_p) { struct device_node *root; - board_time_init = sh_of_time_init; - sh_mv.mv_name = "Unknown SH model"; root = of_find_node_by_path("/"); if (root) { diff --git a/arch/sh/include/asm/rtc.h b/arch/sh/include/asm/rtc.h index fe55fbb..69dbae2 100644 --- a/arch/sh/include/asm/rtc.h +++ b/arch/sh/include/asm/rtc.h @@ -3,7 +3,6 @@ #define _ASM_RTC_H void time_init(void); -extern void (*board_time_init)(void); #define RTC_CAP_4_DIGIT_YEAR (1 << 0) diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index eb0a912..a29eb98 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -22,8 +22,6 @@ #include #include -void (*board_time_init)(void); - static void __init sh_late_time_init(void) { /* @@ -41,8 +39,7 @@ static void __init sh_late_time_init(void) void __init time_init(void) { - if (board_time_init) - board_time_init(); + timer_init(); clk_init();