From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hanjun Guo Subject: Re: [RFC part3 PATCH 2/2] ARM64 / clocksource: Use arch_timer_acpi_init() Date: Tue, 03 Dec 2013 21:52:30 +0800 Message-ID: <529DE21E.4080707@linaro.org> References: <1386069328-22502-1-git-send-email-hanjun.guo@linaro.org> <1386069328-22502-3-git-send-email-hanjun.guo@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-pd0-f179.google.com ([209.85.192.179]:52933 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752542Ab3LCNww (ORCPT ); Tue, 3 Dec 2013 08:52:52 -0500 Received: by mail-pd0-f179.google.com with SMTP id r10so20090832pdi.38 for ; Tue, 03 Dec 2013 05:52:52 -0800 (PST) In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Linus Walleij Cc: Daniel Lezcano , "Rafael J. Wysocki" , Catalin Marinas , Will Deacon , Russell King - ARM Linux , Grant Likely , Matthew Garrett , Olof Johansson , Bjorn Helgaas , Rob Herring , Mark Rutland , Jon Masters , ACPI Devel Maling List , "linux-arm-kernel@lists.infradead.org" , Patch Tracking , "linux-kernel@vger.kernel.org" , linaro-kernel , "linaro-acpi@lists.linaro.org" On 2013=E5=B9=B412=E6=9C=8803=E6=97=A5 20:27, Linus Walleij wrote: > On Tue, Dec 3, 2013 at 12:15 PM, Hanjun Guo w= rote: > >> + /* if can't be initialised from DT, try ACPI way */ >> + if (!arch_timer_get_rate()) >> + arch_timer_acpi_init(); >> + >> arch_timer_rate =3D arch_timer_get_rate(); > This looks a bit fragile. Having a call like arch_timer_get_rate() > to check whether there is a DT node for the timer doesn't seem > right, can you refactor the code to provide some > has_arch_timer_node() or similar call instead, so it's a bit easier > to understand & maintain at least? Good point, thanks for the guidance. I will introduce has_arch_timer_node() as you said and use it as follows: if (has_arch_timer_node()) clocksource_of_init(); esle arch_timer_acpi_init(); /* try ACPI way */ Is this make sense to you? Thanks Hanjun -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html