From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH 2/2] i2c: designware: Add support for a bus clock Date: Wed, 18 Jul 2018 15:52:20 +0300 Message-ID: References: <1531731553-22979-1-git-send-email-phil.edworthy@renesas.com> <1531731553-22979-3-git-send-email-phil.edworthy@renesas.com> <20180717120737.bipotpki3yhn6klf@verge.net.au> <40f2729f38bd565a829d60d9cc8f508e33b0dc65.camel@linux.intel.com> <20180718091448.fw2y7ea6sk2osi3g@verge.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Geert Uytterhoeven , Simon Horman Cc: Phil Edworthy , Jarkko Nikula , Linux I2C , Linux Kernel Mailing List , Linux-Renesas , Mika Westerberg List-Id: linux-i2c@vger.kernel.org On Wed, 2018-07-18 at 13:06 +0200, Geert Uytterhoeven wrote: > On Wed, Jul 18, 2018 at 11:14 AM Simon Horman > wrote: > > if (IS_ERR(dev->buslck) && PTR_ERR(dev->busclk) != -ENOENT) > > return PTR_ERR(dev->busclk); > > > > ... > > As this is a commonly-used construct, perhaps it would be good to > introduce > clk_get_optional() (cfr. gpiod_get_optional()) and > devm_clk_get_optional(), > which would return NULL instead of -ENOENT? > Then it becomes a simple check for IS_ERR() in the driver. I'm puzzled why CCF still lack of such API. -- Andy Shevchenko Intel Finland Oy