Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944684AbcJaQxe (ORCPT ); Mon, 31 Oct 2016 12:53:34 -0400 Received: from mail-db5eur01on0089.outbound.protection.outlook.com ([104.47.2.89]:57216 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S944514AbcJaQxd (ORCPT ); Mon, 31 Oct 2016 12:53:33 -0400 From: Noam Camus To: Daniel Lezcano CC: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "tglx@linutronix.de" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2 2/3] clocksource: update "fn" at CLOCKSOURCE_OF_DECLARE() of nps400 timer Thread-Topic: [PATCH v2 2/3] clocksource: update "fn" at CLOCKSOURCE_OF_DECLARE() of nps400 timer Thread-Index: AQHSLSbe+yjKyh6eZk+XrcBn7SmgVKDCaKsAgAAhXbA= Date: Mon, 31 Oct 2016 15:19:15 +0000 Message-ID: References: <1477224748-25223-1-git-send-email-noamca@mellanox.com> <1477224748-25223-3-git-send-email-noamca@mellanox.com> <20161031102814.GC1506@mai> In-Reply-To: <20161031102814.GC1506@mai> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=noamca@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-office365-filtering-correlation-id: e72ddda2-39e3-46c4-a172-08d401a146a9 x-microsoft-exchange-diagnostics: 1;DB6PR0501MB2520;7:pHD+aub/3B24xeBpFw2ZKyDEPqQ5Txaze+K34l5e9jCCbhjGV1NtwQcLert63sDNvnrwNi0Le6pXgZzz/BIS5TVGYoVylBDQi0vtov+zn6Ay+UvYRq5Lmph8Os57UUjghU1SFFstsGXrH/pjldDIhhKyFJmeEzKfTDBTV0gaai77BnHwH+DcAxZXXRe7dAT5ele+hz7ceVMNB3VGLVtfX2FLmjxbaOTeF0iWQlkmLJMrC2rSG5RNfKjW5M1aYGnbxDhB+kgnq8tHxJtMfIDoMIt0kRIq0wV3lUXXmoDLVSwHYuQWzv9K+d1jMaOYhiJIwmhS7KYQopIotl8wfA0aCkiWOBzUPg7t64BwhPaaum4= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0501MB2520; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:DB6PR0501MB2520;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0501MB2520; x-forefront-prvs: 01128BA907 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(377454003)(189002)(199003)(8676002)(4326007)(81166006)(6116002)(586003)(101416001)(102836003)(3846002)(11100500001)(81156014)(189998001)(76176999)(10400500002)(106116001)(2906002)(66066001)(105586002)(106356001)(54356999)(50986999)(97736004)(87936001)(19580405001)(5002640100001)(19580395003)(8936002)(2900100001)(3660700001)(7846002)(110136003)(5660300001)(2950100002)(7736002)(9686002)(6916009)(68736007)(305945005)(7696004)(122556002)(74316002)(76576001)(92566002)(77096005)(3280700002)(86362001)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0501MB2520;H:DB6PR0501MB2518.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Oct 2016 15:19:15.1335 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2520 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9VGrdYD030057 Content-Length: 1523 Lines: 60 > From: Daniel Lezcano [mailto:daniel.lezcano@linaro.org] > Sent: Monday, October 31, 2016 12:28 PM >> From: Noam Camus >> >> nps_setup_clocksource() should take node as only argument i.e.: >> replace >> int __init nps_setup_clocksource(struct device_node *node, struct clk >> *clk) with int __init nps_setup_clocksource(struct device_node *node) >> >> This is also serve as preperation for next patch which adds support > >s/preperation/preparation/ Thanks, will fix in V4 of this patch set ... >> +static int nps_get_timer_clk(struct device_node *node, >> + unsigned long *timer_freq, >> + struct clk *clk) > >This function prototype does not make sense. A pointer to a clock is passed for nothing here. Thanks, I passed *clk in order for one to do rollback on error (pass clk to clk_disable_unprepare). I will change prototype to **clk. >> +{ >> + int ret; >> + >> + clk = of_clk_get(node, 0); >> + if (IS_ERR(clk)) { >> + pr_err("timer missing clk"); >> + return PTR_ERR(clk); >> + } >> + >> + ret = clk_prepare_enable(clk); >> + if (ret) { >> + pr_err("Couldn't enable parent clk\n"); >> + return ret; >> + } >> + >> + *timer_freq = clk_get_rate(clk); >> + > > timer_freq check. > > rollback on error. Thanks, will fix at V4 ... >> - if (ret) { >> - pr_err("Couldn't enable parent clock\n"); >> - return ret; >> - } >> - >> - nps_timer_rate = clk_get_rate(clk); >> + nps_get_timer_clk(node, &nps_timer_rate, clk); >Return code check ? Thanks, will fix at V4 -Noam