From patchwork Fri Apr 20 15:48:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133897 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp437083ljf; Fri, 20 Apr 2018 08:51:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+1vzL1Amj8u30yAMlpNp3rRT79kwLjNKr50WgT4ksGEV/XNdX9GCTKqpZGUPEMfaWN5avJ X-Received: by 10.99.181.30 with SMTP id y30mr7237722pge.279.1524239494266; Fri, 20 Apr 2018 08:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524239494; cv=none; d=google.com; s=arc-20160816; b=cy7RSddo14nDbyBu7ltS0idwEd2VRTtm7scVcLzmsesKUSxEpeUjJr2Pr03yt7nhXT Rdj7wmByFPH1NFwwycq2wFUTVPhY3vKqwTBXIBWrqrg7N+LWOhMGIdlHbRMKAJU0W/+W XgaW3uyxvuTYd0x5Eshr7N8jPbkq5vCH8hIaIjdbd5tJH0OngAbO4g9inq/x1SVc4Fsx Dv1lZe/CuftviQ1hP7P7SkF5K3560W+zmJkeQkNef7zGGD4S4JUeAKYUGaX4Q/J3MGoA 3kkEtPXuwbFsfHJzWitzDdDG08YWZ5pDFkou/VeMivxCxjnHYLmlKX60HVhkUWCyzSJb gA0g== 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:message-id:date :subject:cc:to:from:arc-authentication-results; bh=SffeirJbJmPmHAQJXrsj9JFB+bUM9jQckq76iFNuAnU=; b=pd64lJ/fx+LfQ6qZ9GMfyfaRNsS06Wv0YXrH7XRPmEY+tE+t2i/75+OGhqlQaxWhcW X74BgSQvqsP5qYqGwsjCdSX6DNVmJ46BaZUBIoxUvcOLPkAQahbfHudga4+uT0oGNQES Rbt7yHJov5HSNNPtw85m5OkH5TeZYDzaNCiyAUCqJ2p6obl3seBhvwoMp1S9RDzR7TK/ 025PaJGBYJtlsRNqnlazkez5wocCmXzaCPAHUz1MGp1nwcFK5LupmdStF1qbpwfajR+a rqa5m/q1zLqJbTWLRpKxMRkmPh9+U5Pwl6sN1HW7UuH8+a5Y1PZakjhFuGZ+Bm8SY2wT mMYw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si2456180pli.275.2018.04.20.08.51.33; Fri, 20 Apr 2018 08:51:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755808AbeDTPvb (ORCPT + 29 others); Fri, 20 Apr 2018 11:51:31 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:37953 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755318AbeDTPva (ORCPT ); Fri, 20 Apr 2018 11:51:30 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LlrG8-1eaUc90ydU-00ZQYs; Fri, 20 Apr 2018 17:51:17 +0200 From: Arnd Bergmann To: Rich Felker Cc: Baolin Wang , Yoshinori Sato , linux-sh@vger.kernel.org, broonie@kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] sh: remove unused rtc_sh_get/set_time infrastructure Date: Fri, 20 Apr 2018 17:48:55 +0200 Message-Id: <20180420154933.3235131-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180420154933.3235131-1-arnd@arndb.de> References: <20180420154933.3235131-1-arnd@arndb.de> X-Provags-ID: V03:K1:0p2jbzaKK86D9LBfxKuJsFlRNChEero7sqL8EGIydd+q3C6j1Va bLs3qQ5wQa1IZWmiJGVqQjVh5pLh1jfQD/nah2jhby1BDQeI0Qgd6Oz9A7XaOMYIzhBW2M1 pqnyivoRRXVYKt8l7q9uSWqD3+MwQs5ifpcumth14R8LocJVwanSpf/474QGAWS3ftIWn6L rHXdTGUihaH1d5zT4Ps2w== X-UI-Out-Filterresults: notjunk:1; V01:K0:74k1vNT1t9I=:E6fIL2ZdQC4ELA6Jr3LSEP dsoju3wmLg6y9qbQ6t7dDAxrj99VZI3k6eCmAyfTB7fGjDkkdNVc+yyr4I+N/2OAy/wU0ek1C vNf3NvAg12mCWsVEE0IhemRprHIrzaFzZN8Shf7bTBNlux4kgP5TpAxvMieo8hG0AM64ZfRZv qAaqmiMUMmroasdNXxwNBBdprojybibFixUTKbeUjHnebOsG8M7f0avNOMzslwTzO5+oaonhx FiOl3XR58E9FjKCVSMeYYEDSLaaUz7OJCPEAtdRZ5vnrKwXRzgyskMy755Nfdkb7dDPT823+f nKyYfw9T71bmmXRwYfemb+mILExxASbNMFq0DQwSRSNKf2zxQapxFfVCKgGpcHnuxsmUcAmlg W7oO71v8epwUwa54+k76gM+LdIKb/klQ4fIFvNwCMvelUXX0Lrp4SCVNK5fQWaxt4QgZJLIPN QoJEXabGSmZH0bo1u1prU1qM5OFZQQskNfyF/k3IdNdrYvTaejD3pTijS2wGafMfYmNhM+GTQ dIkye7m4sXh3JNOGDaPq4wvVHu7y5KvwqrriUWTMz3FPqCsaRWBtnhPGFisyJ+jelV9hrCJIJ FbSYWxPaXQoHi39xEXvPkXUJwCt+WOw+utIqJvSHGbj/6X+CQvIZMZf9/YlLC0RbWluLscmZb oFdRXZih+wRPUFUi/b40huYg7FT4Wxx91yYMIUnNmy2B3U9jRFDxaq71TUsAtlwAd+Jly7yh1 M72ZQJbQ6DXfIOuavMnGT2X2TFWfQKbyX5nmzA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/sh/include/asm/rtc.h | 2 -- arch/sh/kernel/time.c | 69 ----------------------------------------------- 2 files changed, 71 deletions(-) -- 2.9.0 diff --git a/arch/sh/include/asm/rtc.h b/arch/sh/include/asm/rtc.h index c63555ee1255..fe55fbb181aa 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 fcd5e41977d1..eb0a91270499 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)