Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3503254imm; Tue, 17 Jul 2018 06:02:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdZ9q5X3RjEpuRS/ySmF71bQI6TxTpB29cL2fyL/TyUK4QBRjrJiInRd4Mo8+/DXfbnLqUU X-Received: by 2002:a65:4107:: with SMTP id w7-v6mr1470134pgp.302.1531832579290; Tue, 17 Jul 2018 06:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531832579; cv=none; d=google.com; s=arc-20160816; b=B+r1lVkVlzd0z97N1Ulcai2Vpg63cv0L24sVyS53Qp93Lys70vn/xLmOXastJ2AqQi 0EyH88tvQXrdpFmMlsAM1Vp81kwSS5h/saNsQQtXaFE3NOSD6Dzt5MkgJBs1LFsrCnGV TX3OvlUxkliErtPkNJ8GIfXAWaafLiXX6T9+Cl35+w3iOq1dtFHA49zuQIAlWfYW4jBZ vQzlm6nNbSQj3fx/OSm4hOZBvkSopHoskElOdYpPTNze6sf365At72GgQOyvKi8P1qRH 83NgwTvBNr95eRCEB7h826YfEYb4frGRuRo9Lp+XuJwphxd9b/LiEVTzf+Mm8HUwqfhf cTtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=NTsNEzTAW7/1uLisgf+Fjr24kxMJ8/bLGOfcGlQkJg0=; b=h3FWp0bSf8QKHrLMkl9+SGFjYDN0nPNSC4A9pT4NqSO7pbZW88zY6iOWEhavgtsS2T +fiP/G3Gnwvy6yCN/wgq6Bd5CBoRFZV/zkHNtxAv+la3BA0efBz1GSe6oC4csTz8rfUc ZnlKK7xOQ02P1C+L2ODID4fyNd14ZQ7IlML5gC3byalzqOEA76Cib3pEmaLTZpPZe4bc 0oYzcY1uAf+rvNZtlnQMZQACcZghJ+Ebta4T8scJpyUV8+47WI0GVX4yRa7Be3T0f4eK HsNTJ9hO2ehaVT8K651OTghSuxa8A0l+uYp3ip1yiAK8ID/sDlrV9Q03SQEAyTLAB/9o FbLw== ARC-Authentication-Results: i=1; mx.google.com; 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 bc12-v6si785125plb.373.2018.07.17.06.02.42; Tue, 17 Jul 2018 06:02:59 -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; 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 S1731324AbeGQNem (ORCPT + 99 others); Tue, 17 Jul 2018 09:34:42 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:43586 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728889AbeGQNel (ORCPT ); Tue, 17 Jul 2018 09:34:41 -0400 Received: by mail-ua0-f195.google.com with SMTP id x24-v6so597253ual.10; Tue, 17 Jul 2018 06:02:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NTsNEzTAW7/1uLisgf+Fjr24kxMJ8/bLGOfcGlQkJg0=; b=qStyDeELl9rDTJipGg0+sCvTIXiOCjTxC1+kUVuFeL3ifXbIYLsZOsD438fx9Gaj6u +OKECV3w0gncVE8IRTyRF1as/s0RZnLFFfXW1ciWhJAE8QXIpdMcCe76WWX8IHkBwK7E FlCTDFs4o5mgM1CwNvf/JZzi2vz+sXh4zIihSWnUH1ebnPwlwXLzNOD+4bfFjwgpOvHO UtNPYhRd05niVIXsiFs7HnY5xun4G/wxmxI8KryaiphdXrVc6+9yL83mHngEVu1a2CMT AFfpGktRx2ORzf9gCu757/+UcF4kDY/8m2hiG15ZpngEw+TNMRJ+k3HGpGPxrT554mpM t/GA== X-Gm-Message-State: AOUpUlFEuOcXg5srSoYnzF/WegccXOuCZJ1m+5aLY1L4HXvF8L25koW5 y5VUvR5cuPwD+cJTgurLZbP9oytxvnY/ubAleI0= X-Received: by 2002:ab0:5b57:: with SMTP id v23-v6mr955593uae.72.1531832526582; Tue, 17 Jul 2018 06:02:06 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 17 Jul 2018 15:01:54 +0200 Message-ID: Subject: Re: [PATCH 2/2] i2c: designware: Add support for a bus clock To: Phil Edworthy Cc: Andy Shevchenko , Simon Horman , Jarkko Nikula , Linux I2C , Linux Kernel Mailing List , Linux-Renesas , Mika Westerberg Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Phil, On Tue, Jul 17, 2018 at 2:42 PM Phil Edworthy wrote: > On 17 July 2018 13:24, Andy Shevchenko wrote: > > On Tue, 2018-07-17 at 14:07 +0200, Simon Horman wrote: > > > On Mon, Jul 16, 2018 at 09:59:13AM +0100, Phil Edworthy wrote: > > > > The Synopsys I2C Controller has a bus clock, but typically SoCs hide > > > > this away. > > > > However, on some SoCs you need to explicity enable the bus clock in > > > > order to access the registers. > > > > Therefore, enable an optional bus clock specified by DT. > > > > > > + /* Optional bus clock */ > > > > + if (!IS_ERR(dev->busclk)) { > > > > > > I suspect that error values stored in dev->busclk, other than > > > -ENOENT, should be treated as errors. > IS_ERR catches all errors and is the correct way to check the value > returned by devm_clk_get. What if it returns -EPROBE_DEFER, which means the clock is referenced, and thus not optional, but not yet ready? For optional clocks, all errors but -ENOENT should be propagated up. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds