Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1294418imm; Wed, 1 Aug 2018 13:24:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpesO+sro7KwwSJ9wKWPbtIwn7gmX/BMEvQWKoieT+yjRPuhCGcTlo1V57vJla5Gd3yfjeIn X-Received: by 2002:a62:401:: with SMTP id 1-v6mr28145977pfe.28.1533155084071; Wed, 01 Aug 2018 13:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533155084; cv=none; d=google.com; s=arc-20160816; b=O0jRH55mm/xRpP/61IV/P8pTBqvDdVnVi2sgzP9JbOdeQ3c9TiA3WXcz4Mpg+fEkxW sI4FnMRP4vRMMp2HUtNNd3z6Z6I4VWRNcTCCbFsdU78P1gD7IcFZjydojHetAIuaFsYQ rv9jpnhvFbs37cb0JA5TLUDC3zJoHh5SCZEKzTn5WRLLfaG4YGwivEKeXSzI6NmUiCwX QDLiJeKuYMQTF6qXbR0V4hRFbB4YxheOa+neVlF0RbZ+RV/URFRxQwzohv7pEctOHcWs oUV2iQhvEgx/wK/sD0uN5YCmKcVlxY7+gH6+Xsn2CpSQbSBHyDGlOQOvw0qu49AmNhgF 19vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=AnQvRTHKIZj5HsT/xeNJWWXxGJBb5wQji5HEUtSnPhU=; b=Cz2bqoEjjtPwVKa4at0F+JeGVzTtmkMmUl9HO3Hr4kn2FnC3cjJmXnfQtNcfCag88s k5fd23HrXFwMRBPsmLv/MK1BJnUd295fgqnQHpUoMFrjc1RR1dPxdDO/hfb1+hXjxnIL 3+MV8c1zKK4GgwZKTlDmclyDSmUS5k+0+rsekkyanEciQ7/cz2iaHSfvhwujGhFAQmmC KyS1Z+rv8Q+vnN/r6JQb6mrw19cjAuvFyyT5k0p3U/cTXH3X+61yAiol5ZfEAq8PCae2 xzOD9lmH7jwulZp10BOC4w4t5zjNh24omOEqBvUmuYoj4coiAI2t9f6A6tEGzozSxwZe HIag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=D038rJL1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10-v6si16976600pfc.51.2018.08.01.13.24.29; Wed, 01 Aug 2018 13:24:44 -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=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=D038rJL1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732199AbeHAWLA (ORCPT + 99 others); Wed, 1 Aug 2018 18:11:00 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:44768 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbeHAWLA (ORCPT ); Wed, 1 Aug 2018 18:11:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AnQvRTHKIZj5HsT/xeNJWWXxGJBb5wQji5HEUtSnPhU=; b=D038rJL1jsni08C+C+rjBSLQH NcgMLUjDe0E/SzcPDVsj+Jg1NgmPSfNXO2Z3fA6vBiKLRojgx9AHGf18MCUVBLiR9Pa+MDsJnImXj osmsT/+Gw8ZIrjt3WaTcotayTeW9+jtm3l5FSNyl3PAMHM236ij7QBU257aXacqVGsSSI=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:48555) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fkxeQ-0005Pz-KA; Wed, 01 Aug 2018 21:23:18 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1fkxeN-0000DC-PJ; Wed, 01 Aug 2018 21:23:15 +0100 Date: Wed, 1 Aug 2018 21:23:14 +0100 From: Russell King - ARM Linux To: Andrew Lunn Cc: Arun Parameswaran , Florian Fainelli , "David S. Miller" , Rob Herring , Mark Rutland , Ray Jui , Scott Branden , Catalin Marinas , Will Deacon , netdev@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 7/8] net: phy: Add support to configure clock in Broadcom iProc mdio mux Message-ID: <20180801202313.GH30658@n2100.armlinux.org.uk> References: <1533146186-8374-1-git-send-email-arun.parameswaran@broadcom.com> <1533146186-8374-8-git-send-email-arun.parameswaran@broadcom.com> <0cc6db4f-7008-0ad3-58d7-9e93060f152f@gmail.com> <20180801184659.GG30658@n2100.armlinux.org.uk> <9af7e7a3-54d4-8802-f64a-fc4f9c49c8b9@broadcom.com> <20180801200712.GD19257@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180801200712.GD19257@lunn.ch> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 01, 2018 at 10:07:12PM +0200, Andrew Lunn wrote: > You might want to consider adding clk_optional_get() and > devm_clk_optional_get(). I think there's attempts to add such APIs but I don't think it's trivial - it seems to require a _lot_ of discussion. I think part of that is because of the quirky use of error codes. If you look at clk_get(), it calls __of_clk_get_by_name() which returns: -ENOENT if DT is disabled -ENOENT if the device has no DT node -EPROBE_DEFER if the lookup in DT succeeds but there's no registered clock -EINVAL if the device has a DT node but the lookup of the name failed (in otherwords, the optional clock was omitted) -ENOENT if the clocks = property has not enough clocks for the clock-names property -ENOMEM if we fail to allocate the clk -ENOENT if __clk_get() fails or any other error code returned via of_clk_provider's ->get() method. The use of -EINVAL, one of the most common error codes, makes it difficult to be sure that the clock is not specified in DT. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 13.8Mbps down 630kbps up According to speedtest.net: 13Mbps down 490kbps up