Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp685448yba; Fri, 12 Apr 2019 11:33:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnoONlxCbx9sWt/583rj9gAebkjVNPBDr6I7xyATdsYcD2ThWy8Yzj8pt/FuCxsZsHkCpN X-Received: by 2002:a63:2b03:: with SMTP id r3mr54278951pgr.105.1555094021271; Fri, 12 Apr 2019 11:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555094021; cv=none; d=google.com; s=arc-20160816; b=jFcWq7+2ssql3+I+pdFoRpjZPHmG6/jxsULlrQmUtomcwhLLkQS7bzClEaXceasFhT 9PIhXSrs7+YWNb7bfq1AkiDPhrvFnDrAbf11QboMfAoMITjtSK8EjvtQtBp2SP9paJhv bMhN9cr695Pxf8CuKMBjkO87ykUd8BADG33dCpvsQu27a0B/Q7SNSyW1vapOxGh5meKY CFwOwtKgWo0n/qlMo+AQXgpoRW8zJRXIX37nhyBg0JZtGFWKvPJ8dRpHsNlYpW8bYUT9 nblSVEkmTuqwwmFHZYTsyNohLcfwy8CkUEm8NhKRkBAlHfr1XLqoCPhlSzF15yOAue4A wcCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tj0303ESL32gR0Exmwpfl3uxndM//MrRCBubW5ACyR0=; b=OvPcgnuBQlsyqAOGAKAFLr8T+xS59PgmrmoeXyqiRxfAzfsCW5wXuY7sd2xzJ4hS/6 uEPcELg4MOc6nk/7OwZGOgR+XfbwaSOUILoxT2veQ45EpRU0SewTUI+BqMZTFpoxaU+U fOQF0uNUcTcbqtMk67D7dSh+KqjySHh3qdjPr8m1YjQARRRSBXet0DZRJXOs4pJU2S2h w8XWIn2MQ5LlMYJm+bvEIoFBdcnVF2+74Ggnd6/lt2/Un87OzfHI/nVu6Qr5NCu4fgnW pnwK3PL4ZiuZ1el/O7/Cj+vNERKUEfXqhsO7TBTEkgGM3cYJ3gUUM1lbXzo1ZenAWwgT Gvtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OHIBg7Hr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si15485156pgk.486.2019.04.12.11.33.25; Fri, 12 Apr 2019 11:33: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=@kernel.org header.s=default header.b=OHIBg7Hr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727241AbfDLSc1 (ORCPT + 99 others); Fri, 12 Apr 2019 14:32:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:50350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbfDLSby (ORCPT ); Fri, 12 Apr 2019 14:31:54 -0400 Received: from mail.kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8DF4B218D2; Fri, 12 Apr 2019 18:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555093912; bh=LZEUR8eiDUJq7nEmBI5Ou+kM+A9lWl2yePObSye2+60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHIBg7Hr26kVcuqViykm27cU+gZ4JgCKm1JSMHqjON69ChBm+n22PvKxW4PaZrr7U 5j6424nGaxkdl6wf5s9Zwa9v+3J/dfJ17MTnHQaxlqfryMQRYrlpg1gxpH1WxdtPED iDKYVEMW5/sWeRNpvDpqKlBxOm3QyZYLxx8mQir8= From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Miquel Raynal , Jerome Brunet , Russell King , Jeffrey Hugo , Chen-Yu Tsai , Rob Herring Subject: [PATCH v4 3/9] clk: Prepare for clk registration API that uses DT nodes Date: Fri, 12 Apr 2019 11:31:44 -0700 Message-Id: <20190412183150.102131-4-sboyd@kernel.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190412183150.102131-1-sboyd@kernel.org> References: <20190412183150.102131-1-sboyd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Split out the body of the clk_register() function so it can be shared between the different types of registration APIs (DT, device). Cc: Miquel Raynal Cc: Jerome Brunet Cc: Russell King Cc: Michael Turquette Cc: Jeffrey Hugo Cc: Chen-Yu Tsai Cc: Rob Herring Signed-off-by: Stephen Boyd --- drivers/clk/clk.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 96053a96fe2f..d27775a73e67 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3313,18 +3313,7 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw, return clk; } -/** - * clk_register - allocate a new clock, register it and return an opaque cookie - * @dev: device that is registering this clock - * @hw: link to hardware-specific clock data - * - * clk_register is the primary interface for populating the clock tree with new - * clock nodes. It returns a pointer to the newly allocated struct clk which - * cannot be dereferenced by driver code but may be used in conjunction with the - * rest of the clock API. In the event of an error clk_register will return an - * error code; drivers must test for an error code after calling clk_register. - */ -struct clk *clk_register(struct device *dev, struct clk_hw *hw) +static struct clk *__clk_register(struct device *dev, struct clk_hw *hw) { int i, ret; struct clk_core *core; @@ -3426,6 +3415,22 @@ struct clk *clk_register(struct device *dev, struct clk_hw *hw) fail_out: return ERR_PTR(ret); } + +/** + * clk_register - allocate a new clock, register it and return an opaque cookie + * @dev: device that is registering this clock + * @hw: link to hardware-specific clock data + * + * clk_register is the primary interface for populating the clock tree with new + * clock nodes. It returns a pointer to the newly allocated struct clk which + * cannot be dereferenced by driver code but may be used in conjunction with the + * rest of the clock API. In the event of an error clk_register will return an + * error code; drivers must test for an error code after calling clk_register. + */ +struct clk *clk_register(struct device *dev, struct clk_hw *hw) +{ + return __clk_register(dev, hw); +} EXPORT_SYMBOL_GPL(clk_register); /** @@ -3440,7 +3445,7 @@ EXPORT_SYMBOL_GPL(clk_register); */ int clk_hw_register(struct device *dev, struct clk_hw *hw) { - return PTR_ERR_OR_ZERO(clk_register(dev, hw)); + return PTR_ERR_OR_ZERO(__clk_register(dev, hw)); } EXPORT_SYMBOL_GPL(clk_hw_register); -- Sent by a computer through tubes