Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp400888imm; Thu, 30 Aug 2018 01:32:41 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdam6zLpbUO+agS2BjVLe9xYY2B1u7cbr9H65fc4KdNpLr3UMqfVPWGJcpkbYTJfulEUmow2 X-Received: by 2002:a62:5302:: with SMTP id h2-v6mr9600733pfb.183.1535617961282; Thu, 30 Aug 2018 01:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535617961; cv=none; d=google.com; s=arc-20160816; b=ekTC/4RHtuhqU6kYSDeJroIeIMZwcud4lahS2+sVl8xC6EnDTC+/Jq8UurxXqIlru5 9aBdmBkkGVZgNY55+xBkhRe+BE3owVlUM/2K7lhmGTx2RdskHBrNZCv3VhaHNW6qiKsT F6XMGq6rp9sC/w918sDmPphlzuCpiW0gAR5yCzpX6yzRF/iMuIDFND7q/RxXMl7F1Zh2 3/VhpVBYXjTkv8/v8c2q4kHE91JBS0dJw0jHp4FNl/vuCWDxBINgsgBBzpCmAIgVeErm V//R4xYaBYWJXxJeirbLvx/hMn8f8LzfKyBBNCorh9M+B/HQkt54Sg3nYVHA3sAI5l6Z mJdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=UirDQkwhjpBEeCUFhZPJdrdz6G4yp5jCfmCdXXjn+tQ=; b=aVYSw3tNp1UHVwNYG8Q3LHbRUsJpglBe5RNBHVil5hIG8xom95Sp/KOgZByCxeMzya d/nn5bcUPfl0OYw3ElAyc3LjsY+0PLkLV7VoZnY8Yijxlhnt90LjjUXxHRm3QyxeLyEp z+tNyuvRebvxjRghYuGquITQcdlGKrtqNaUHJo4TAJfYsInJ4Y80VUQbbIa9/e3OkGzV /Gq2Gb4nIeNJw/NdmkKw5AK1LkXQHjU9zyyk5BpN/457sUZ5W3zu4bny/yfcqJXb8R+q hbE24VNyzTPLS9rIrJRY/LNL3mHP7jw/qDq7blfzN3vnWRX6O1Na0uOc2hJgxWZSXg3z jP6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b=LHULN1qX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si5865880pld.329.2018.08.30.01.32.26; Thu, 30 Aug 2018 01:32:41 -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=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b=LHULN1qX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbeH3McJ (ORCPT + 99 others); Thu, 30 Aug 2018 08:32:09 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:18079 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727688AbeH3McI (ORCPT ); Thu, 30 Aug 2018 08:32:08 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 30 Aug 2018 17:31:05 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 9EDBD866F8; Thu, 30 Aug 2018 17:31:05 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,306,1531753200"; d="scan'208";a="291056169" Received: from mail-os2jpn01lp0152.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.152]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Aug 2018 17:31:03 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UirDQkwhjpBEeCUFhZPJdrdz6G4yp5jCfmCdXXjn+tQ=; b=LHULN1qXiJ9bXtfF0UrDTvyYjUAxHNspZn3+gCkvfolvnQPdDWLkrjVP3P4phTGJ2NLJlgElXR+1yBQCOlXNGhNXcheKeeZU+us9hngZezJqynIOw5+gV/QmpD09WEvqc+e6Dm6wLl3P7A57Dnsoec3eK78mtBFkazn9NOzOhKc= Received: from TY1PR01MB1769.jpnprd01.prod.outlook.com (52.133.163.146) by TY1PR01MB0334.jpnprd01.prod.outlook.com (10.161.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.13; Thu, 30 Aug 2018 08:31:00 +0000 Received: from TY1PR01MB1769.jpnprd01.prod.outlook.com ([fe80::7c89:e594:b792:97eb]) by TY1PR01MB1769.jpnprd01.prod.outlook.com ([fe80::7c89:e594:b792:97eb%4]) with mapi id 15.20.1080.015; Thu, 30 Aug 2018 08:31:00 +0000 From: Phil Edworthy To: Andy Shevchenko CC: Michael Turquette , Stephen Boyd , Russell King , Geert Uytterhoeven , Simon Horman , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH v4 1/2] clk: Add of_clk_get_by_name_optional() function Thread-Topic: [PATCH v4 1/2] clk: Add of_clk_get_by_name_optional() function Thread-Index: AQHUKMec3KUQcPGA60W10ctOf+LYP6TXJNuAgAD/sTA= Date: Thu, 30 Aug 2018 08:30:59 +0000 Message-ID: References: <1533039060-18779-1-git-send-email-phil.edworthy@renesas.com> <1533039060-18779-2-git-send-email-phil.edworthy@renesas.com> <20180829171039.GD11447@smile.fi.intel.com> In-Reply-To: <20180829171039.GD11447@smile.fi.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=phil.edworthy@renesas.com; x-originating-ip: [193.141.220.21] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;TY1PR01MB0334;20:8t8L7rW2AKMi2ELVzz3rrlq4LBWo2CsaopoJ0Erf2cOMqqfhHBwzuaDqknKmNiHxcfRHqc2yD7E33EnHpHE9vKfXe7O1V9qO6GP3CbtQeFsGstdghVXXaVy0vYqyq5QNUQ2vGvOyI0fR02+EuJtGa8VPMmxw3sYorZir2LYUygM= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 4eaca412-80dc-4dc7-5dc2-08d60e52ea56 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:TY1PR01MB0334; x-ms-traffictypediagnostic: TY1PR01MB0334: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:TY1PR01MB0334;BCL:0;PCL:0;RULEID:;SRVR:TY1PR01MB0334; x-forefront-prvs: 07807C55DC x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(136003)(346002)(366004)(39860400002)(51914003)(189003)(199004)(7736002)(256004)(6916009)(446003)(305945005)(14444005)(66066001)(11346002)(74316002)(229853002)(476003)(76176011)(9686003)(5250100002)(55016002)(7696005)(53936002)(6436002)(8676002)(2906002)(8936002)(486006)(81156014)(81166006)(4326008)(25786009)(97736004)(33656002)(44832011)(316002)(54906003)(6246003)(99286004)(105586002)(106356001)(26005)(6506007)(53546011)(2900100001)(478600001)(186003)(6116002)(3846002)(14454004)(102836004)(5660300001)(86362001)(68736007);DIR:OUT;SFP:1102;SCL:1;SRVR:TY1PR01MB0334;H:TY1PR01MB1769.jpnprd01.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1ffoV1tO+s54atRTslE1HQKZ7r9irelruxLOKChhjdfY3DKumXxDtm1a0OhSoQU5Pcdw1sbP2uotcgBy/EDo35sLhZgZAbyKsQWMLKYNaHgTGuH+OxZHYf2qTd5Lslwkw84txLJOjbQjO+UleQZ/sPlP6661a+igzS42TGWrU8RsxITD9jUaKeOwjHWP9MXmEn+3qw3mga/Xv0Znn1faVf/WltLhbZjkSPZDwXLatEWXBQehdceWlwgsXEu6FFQbBTymeENJa976JEtZmX/1K8g5HLKIvZ5wFKP5UWcxtrBFxGxSHTV1dxd2bFRA4T8YARPnHWcgMCvNIxteWlENSnICLmDuekBvC5yBZCP08HE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4eaca412-80dc-4dc7-5dc2-08d60e52ea56 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2018 08:30:59.9078 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB0334 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On 29 August 2018 18:11 Andy Shevchenko wrote: > On Tue, Jul 31, 2018 at 01:10:59PM +0100, Phil Edworthy wrote: > > Quite a few drivers get an optional clock, e.g. a clock required > > to access peripheral's registers that is always enabled on some > > devices. > > > > This function behaves the same as of_clk_get_by_name() except that > > it will return NULL instead of -ENOENT. >=20 > > + if (optional && (index =3D=3D -EINVAL || index =3D=3D -ENODATA || > > + PTR_ERR(clk) =3D=3D -ENOENT)) { >=20 > A nit: I would rather rearrange this to be >=20 > if (optional && > (... || ... || ...)) { >=20 > (disregard 80 characters limit for second line) Thanks for the review. I'm not particularly happy with the patch as is, it'= s pretty messy. I was in rush trying to get things done before holidays - alw= ays a mistake. Would you mind if I sent a v5 that I feel is somewhat clearer? Thanks Phil