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)