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: 10529081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 77AA2600D0 for ; Tue, 17 Jul 2018 11:25:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6268828BAB for ; Tue, 17 Jul 2018 11:25:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5674428C20; Tue, 17 Jul 2018 11:25:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3A4028BAB for ; Tue, 17 Jul 2018 11:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731443AbeGQL51 (ORCPT ); Tue, 17 Jul 2018 07:57:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36315 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731215AbeGQL51 (ORCPT ); Tue, 17 Jul 2018 07:57:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id m19-v6so319087pgv.3 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=Msb3aWXy4dIEuUU7DG6CBRQeo//xAsXQ0ZEWkki9/Q3+7dcHdqBQ6df4iLn5hqyul2 6b3xwpvL0u433QFxSFzxZc8UImVVM4Wd4xotErY0zcHeZT7qKjPCwoaUuq6GIUBBmS5r Uy7ef+/lMUm5kHCC9uhJqcSCWuIvFrAD2ecDKhOOIxkURdZenvi5eEEdeW0ZjPmTmeSJ bW3pDc9bKaeUpsyfew8/3KQbigvVD1xtzJUrS6eSCqqhPgeikBpzOdWDHDIco/5USdCg RXdOMoMxVT6Wnqq1DjCaVeRfvbH+s3Z151cE9ZOY7D6QWEvl5g69c8e0tm4i/Yykk5Ud yJ8w== X-Gm-Message-State: AOUpUlF4kG2Zzf1BSABqfK7Fx4ahk4QXS8oLq3h03svQFfRmZtCoNKem E+2rSeVtv8qIvrK5BOfGTXcsZg== X-Google-Smtp-Source: AAOMgpcqo65mJuS0JOHoycEmNoSSysehi88+Kks0bC3V30jrKvFMpkP3I9eh17JhP4TKOWn8zysZIw== 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-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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)