From: "Tanwar, Rahul" Subject: Re: [PATCH v1 1/2] x86/rtc: Add option to skip using RTC Date: Mon, 26 Aug 2019 17:01:31 +0800 Message-ID: <1628049a-e7f7-6f07-db9d-ef716b5a95df@linux.intel.com> References: <20190822090208.GJ30120@smile.fi.intel.com> <25f6947d-7ba0-c23c-25aa-c4c4173da6b0@linux.intel.com> <20190822130429.GN30120@smile.fi.intel.com> <20190823125604.GS30120@smile.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190823125604.GS30120@smile.fi.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Andy Shevchenko Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, tony.luck@intel.com, x86@kernel.org, a.zummo@towertech.it, alexandre.belloni@bootlin.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, alan@linux.intel.com, linux-kernel@vger.kernel.org, qi-ming.wu@intel.com, cheol.yong.kim@intel.com, rahul.tanwar@intel.com List-Id: devicetree@vger.kernel.org Hi Andy, On 23/8/2019 8:56 PM, Andy Shevchenko wrote: >>>> get_wallclock() and set_wallclock() are function pointers of platform_ops >>>> >>>> which are initialized to mach_get_cmos_time() and mach_set_rtc_mmss() >>>> >>>> at init time. Since adding a new platform to override these functions is >>>> >>>> discouraged, so the only way is to modify RTC get/set functions. >>> Shouldn't it be platform agnostic code? >>> So, my point is, instead of hacking two functions, perhaps better to avoid them >>> at all. >> Sorry, i could not understand your point. The changes are platform >> >> agnostic i.e. it doesn't break existing use cases. Are you recommending >> >> to add a new platform and make changes there ? > Nope, I propose to do something like > > void __init foo() > { > if (platform has RTC) > return; > > set_wallclock = noop; > get_wallclock = noop; > } Thanks. I will work out a V2 patch as per your suggestion and send out for review again. Regards, Rahul