From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Wed, 27 Apr 2016 10:34:19 +0000 Subject: Re: [PATCH v2 1/6] rtc: m68k: provide rtc_class_ops directly Message-Id: <4888267.R0sXv0tuDQ@wuerfel> List-Id: References: <1461707551-1337971-1-git-send-email-arnd@arndb.de> <1461707551-1337971-2-git-send-email-arnd@arndb.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Geert Uytterhoeven Cc: Alexandre Belloni , Helge Deller , Benjamin Herrenschmidt , Michael Ellerman , Rich Felker , David Howells , alpha , Alessandro Zummo , "linux-kernel@vger.kernel.org" , Parisc List , "linuxppc-dev@lists.ozlabs.org" , Linux-sh list , linux-m68k , RTCLINUX , Linux-Arch On Wednesday 27 April 2016 09:47:56 Geert Uytterhoeven wrote: > > --- a/arch/m68k/kernel/time.c > > +++ b/arch/m68k/kernel/time.c > > @@ -86,7 +86,24 @@ void read_persistent_clock(struct timespec *ts) > > } > > } > > > > -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET > > +#if defined(CONFIG_ARCH_USES_GETTIMEOFFSET) && defined(CONFIG_RTC_DRV_GENERIC) > > s/defined/IS_ENABLED/ for the modular case. Thanks, fixed in all three architectures/ > > @@ -95,7 +112,10 @@ static int __init rtc_init(void) > > if (!mach_hwclk) > > return -ENODEV; > > > > - pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0); > > + /* or just call devm_rtc_device_register instead? */ > > I guess this comment is a bogus leftover? There's no "dev" parameter to > pass to devm_rtc_device_register() here. Sort of. When I wrote it, I thought that a NULL argument would work, and I later found out myself that it doesn't. I'll drop the comment there, but there are still a few ways we (probably not me, but whoever is interested) could take this further: - register both the device and the driver here, and call devm_rtc_device_register from the probe function so we can move away from drivers/rtc/rtc-generic.c - do this separately for mac, mvme147, mvme16x, sun3, q40 and sun3x - move the six implementations into drivers/rtc as standalone drivers. One (AFAIK) unsolved problem here is the question of how to handle read_boot_clock/read_persistent_clock/update_persistent_clock in this case. This is a really odd API that is implemented in various ways on a few major architectures, and not at all on others, so it's all highly inconsistent. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v2 1/6] rtc: m68k: provide rtc_class_ops directly Date: Wed, 27 Apr 2016 12:34:19 +0200 Message-ID: <4888267.R0sXv0tuDQ@wuerfel> References: <1461707551-1337971-1-git-send-email-arnd@arndb.de> <1461707551-1337971-2-git-send-email-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Alexandre Belloni , Helge Deller , Benjamin Herrenschmidt , Michael Ellerman , Rich Felker , David Howells , alpha , Alessandro Zummo , "linux-kernel@vger.kernel.org" , Parisc List , "linuxppc-dev@lists.ozlabs.org" , Linux-sh list , linux-m68k , RTCLINUX , Linux-Arch To: Geert Uytterhoeven Return-path: In-Reply-To: List-ID: List-Id: linux-parisc.vger.kernel.org On Wednesday 27 April 2016 09:47:56 Geert Uytterhoeven wrote: > > --- a/arch/m68k/kernel/time.c > > +++ b/arch/m68k/kernel/time.c > > @@ -86,7 +86,24 @@ void read_persistent_clock(struct timespec *ts) > > } > > } > > > > -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET > > +#if defined(CONFIG_ARCH_USES_GETTIMEOFFSET) && defined(CONFIG_RTC_DRV_GENERIC) > > s/defined/IS_ENABLED/ for the modular case. Thanks, fixed in all three architectures/ > > @@ -95,7 +112,10 @@ static int __init rtc_init(void) > > if (!mach_hwclk) > > return -ENODEV; > > > > - pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0); > > + /* or just call devm_rtc_device_register instead? */ > > I guess this comment is a bogus leftover? There's no "dev" parameter to > pass to devm_rtc_device_register() here. Sort of. When I wrote it, I thought that a NULL argument would work, and I later found out myself that it doesn't. I'll drop the comment there, but there are still a few ways we (probably not me, but whoever is interested) could take this further: - register both the device and the driver here, and call devm_rtc_device_register from the probe function so we can move away from drivers/rtc/rtc-generic.c - do this separately for mac, mvme147, mvme16x, sun3, q40 and sun3x - move the six implementations into drivers/rtc as standalone drivers. One (AFAIK) unsolved problem here is the question of how to handle read_boot_clock/read_persistent_clock/update_persistent_clock in this case. This is a really odd API that is implemented in various ways on a few major architectures, and not at all on others, so it's all highly inconsistent. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753820AbcD0KfB (ORCPT ); Wed, 27 Apr 2016 06:35:01 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:64851 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752392AbcD0Ke7 (ORCPT ); Wed, 27 Apr 2016 06:34:59 -0400 From: Arnd Bergmann To: Geert Uytterhoeven Cc: Alexandre Belloni , Helge Deller , Benjamin Herrenschmidt , Michael Ellerman , Rich Felker , David Howells , alpha , Alessandro Zummo , "linux-kernel@vger.kernel.org" , Parisc List , "linuxppc-dev@lists.ozlabs.org" , Linux-sh list , linux-m68k , RTCLINUX , Linux-Arch Subject: Re: [PATCH v2 1/6] rtc: m68k: provide rtc_class_ops directly Date: Wed, 27 Apr 2016 12:34:19 +0200 Message-ID: <4888267.R0sXv0tuDQ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1461707551-1337971-1-git-send-email-arnd@arndb.de> <1461707551-1337971-2-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:DOm5Gp8gwBET6z1pvTwuJfIDuGDVRO28n3Mrju0h6Lgy2Sfboc7 dFRBzP/+YqZN3uD3oGh3DsmkDw+xtyk+uVfn6Ore6LynWHVlgir+/t3KaItQXwZwvxqhnh1 nSlI4cPjcMyS1tePkmT/H+z64qm0RHRPSNZ1TSNxkE4KEyjT2YWX9mMXkY6KPdV0dE+WLaW wQsvJDGdN7Bc5oevOJ96Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:GqpceevSirk=:4cWFckKEBnFZvIWQTkS4kL UgBqm6IJHLI8FZLTC9zOYM6ZcbiH2ip6yYCaRuVY4DmEfMeVKryb98BjQnGoU0qepdDprSvh9 Eq0EltTbXlqzGEGE1RsSxR7syVYPx+dxesmOf0Dr7gro7PhXtn7oRzHEqZMXV9BAyXi0mPveJ BbUgnH6B6+VdW+KckJ/s4ZbU1M6+1jxB20gvteuwXsWevZs375rL00nyi7D5JSmGGv8SUvxN1 lI4hRewCdRI3fZFivBhEQCDnQ4TtutPpAlQYr/9SzfEB6ACObPTRc87eRkAfKkdOZhdthhpWA OsdedP1zwEJwiGDXPLerBUZPNwzG/RZsolPQO/HtAcT6Pmcm/uE2W3LWsjmve6hUBx6G+Tbzm gYey1XtHt5d1h49PQeNNYwdD1OnnpI1knEspb5VqJXIxXYH3Z2IcXxKv0+FSKlozBTwDX80/z pGVutLvFMcjUT2gHFrrhoFpE3kWybhiAqQuf4yQVBSfVCiYNAw+OUu0rVA/Jls3pjt5rktXT/ 9RFTRQp9Fnh3Qfc9Ylje/CWor6x6Rwp9MZv0P472Rem4KgpoI7DN51nzlEy393LE7iaCfQMkH oNpOJrHpFMmEZ4GyIytLIiyh3W7qkitU/VidKGR39di02sSBwQkvh4KhdGXLJTNms2ppo/sfz /NWeVaSddWUcasprPXCiC4AnhR1CRZf3nTN6voHSs4PnkkYCFzkm1RQTz8IQY7i4EGRpJEETN P8evqb6N1mqU1Q1f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 27 April 2016 09:47:56 Geert Uytterhoeven wrote: > > --- a/arch/m68k/kernel/time.c > > +++ b/arch/m68k/kernel/time.c > > @@ -86,7 +86,24 @@ void read_persistent_clock(struct timespec *ts) > > } > > } > > > > -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET > > +#if defined(CONFIG_ARCH_USES_GETTIMEOFFSET) && defined(CONFIG_RTC_DRV_GENERIC) > > s/defined/IS_ENABLED/ for the modular case. Thanks, fixed in all three architectures/ > > @@ -95,7 +112,10 @@ static int __init rtc_init(void) > > if (!mach_hwclk) > > return -ENODEV; > > > > - pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0); > > + /* or just call devm_rtc_device_register instead? */ > > I guess this comment is a bogus leftover? There's no "dev" parameter to > pass to devm_rtc_device_register() here. Sort of. When I wrote it, I thought that a NULL argument would work, and I later found out myself that it doesn't. I'll drop the comment there, but there are still a few ways we (probably not me, but whoever is interested) could take this further: - register both the device and the driver here, and call devm_rtc_device_register from the probe function so we can move away from drivers/rtc/rtc-generic.c - do this separately for mac, mvme147, mvme16x, sun3, q40 and sun3x - move the six implementations into drivers/rtc as standalone drivers. One (AFAIK) unsolved problem here is the question of how to handle read_boot_clock/read_persistent_clock/update_persistent_clock in this case. This is a really odd API that is implemented in various ways on a few major architectures, and not at all on others, so it's all highly inconsistent. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: rtc-linux@googlegroups.com Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.75]) by gmr-mx.google.com with ESMTPS id a65si856351wma.0.2016.04.27.03.34.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2016 03:34:39 -0700 (PDT) From: Arnd Bergmann To: Geert Uytterhoeven Cc: Alexandre Belloni , Helge Deller , Benjamin Herrenschmidt , Michael Ellerman , Rich Felker , David Howells , alpha , Alessandro Zummo , "linux-kernel@vger.kernel.org" , Parisc List , "linuxppc-dev@lists.ozlabs.org" , Linux-sh list , linux-m68k , RTCLINUX , Linux-Arch Subject: [rtc-linux] Re: [PATCH v2 1/6] rtc: m68k: provide rtc_class_ops directly Date: Wed, 27 Apr 2016 12:34:19 +0200 Message-ID: <4888267.R0sXv0tuDQ@wuerfel> In-Reply-To: References: <1461707551-1337971-1-git-send-email-arnd@arndb.de> <1461707551-1337971-2-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , On Wednesday 27 April 2016 09:47:56 Geert Uytterhoeven wrote: > > --- a/arch/m68k/kernel/time.c > > +++ b/arch/m68k/kernel/time.c > > @@ -86,7 +86,24 @@ void read_persistent_clock(struct timespec *ts) > > } > > } > > > > -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET > > +#if defined(CONFIG_ARCH_USES_GETTIMEOFFSET) && defined(CONFIG_RTC_DRV_GENERIC) > > s/defined/IS_ENABLED/ for the modular case. Thanks, fixed in all three architectures/ > > @@ -95,7 +112,10 @@ static int __init rtc_init(void) > > if (!mach_hwclk) > > return -ENODEV; > > > > - pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0); > > + /* or just call devm_rtc_device_register instead? */ > > I guess this comment is a bogus leftover? There's no "dev" parameter to > pass to devm_rtc_device_register() here. Sort of. When I wrote it, I thought that a NULL argument would work, and I later found out myself that it doesn't. I'll drop the comment there, but there are still a few ways we (probably not me, but whoever is interested) could take this further: - register both the device and the driver here, and call devm_rtc_device_register from the probe function so we can move away from drivers/rtc/rtc-generic.c - do this separately for mac, mvme147, mvme16x, sun3, q40 and sun3x - move the six implementations into drivers/rtc as standalone drivers. One (AFAIK) unsolved problem here is the question of how to handle read_boot_clock/read_persistent_clock/update_persistent_clock in this case. This is a really odd API that is implemented in various ways on a few major architectures, and not at all on others, so it's all highly inconsistent. Arnd -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.