From patchwork Tue Aug 16 14:52:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9284113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C6A7660839 for ; Tue, 16 Aug 2016 14:52:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B836F286B3 for ; Tue, 16 Aug 2016 14:52:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC87E286F3; Tue, 16 Aug 2016 14:52:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56029286B3 for ; Tue, 16 Aug 2016 14:52:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZfhv-0002Ha-E9; Tue, 16 Aug 2016 14:51:11 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZfhp-0002G5-9w for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2016 14:51:06 +0000 Received: by mail-wm0-x22d.google.com with SMTP id i5so173167702wmg.0 for ; Tue, 16 Aug 2016 07:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k5QgVYNZ/Hao/5X/pWlQoxWFP3tZmTNOP6GPllIkplI=; b=CN+G3/lmkhUAAn9jqCn6q0b/jrPs4rSfv2B6PXTM4tj93XVsYypq2XEQE+xaZstIPI lI5wCsEKeHN5zJg4sStriRhM+kJMkj1139D7sQYfYFlytUe4/KQOUtmVlnCo20m7xWnx 3FA4DV+sf008YvtcqfkLYKQdU2WcyiTEgim4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=k5QgVYNZ/Hao/5X/pWlQoxWFP3tZmTNOP6GPllIkplI=; b=lTcOn0miGzwrLYbAfi0OiHoiWW2GRj/IWi8hfKVi0GD2Z+97xxLYU++msMTKuyrmI6 mYCCD7mMtdkBjjEe2FqkYD6x5xvpfKt3A2MLYDxdzFG9f/2ih0FjV6JgfeLKlhXMJcsf 4uCHiObZqA+YFi6vPW3WOU3pYhC0T/O7CXUKWOYp3UsXh7qbkPf5J61vAY6cj4gWiHDQ V90xFvzcG/X8vgVxPegQCIKECeScxxaGJFMOZqqO7XQ6bRCNvd7VxHKNDZnmprindZuJ 67MylFotuJ7vbmsmKvVsZFt2gxg4gEfuOU/UdWQNbMlYgHoSx5uSowRDIyB3ViOPX27F ximg== X-Gm-Message-State: AEkoouvQZF2Fqa0i5ZRT8FdDtBrPxv1g0RaxqfG1c2ERNmGc5jVxjb+JfK4mK7GoP7riFxAL X-Received: by 10.28.176.5 with SMTP id z5mr21840887wme.47.1471359040651; Tue, 16 Aug 2016 07:50:40 -0700 (PDT) Received: from dell (host81-129-169-93.range81-129.btcentralplus.com. [81.129.169.93]) by smtp.gmail.com with ESMTPSA id v134sm22140010wmf.10.2016.08.16.07.50.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 07:50:40 -0700 (PDT) Date: Tue, 16 Aug 2016 15:52:12 +0100 From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/2+1] remoteproc: core: Move of_get_rproc() helper to header Message-ID: <20160816145212.GA4254@dell> References: <20160816143824.4120-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160816143824.4120-1-lee.jones@linaro.org> User-Agent: Mutt/1.6.2 (2016-07-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160816_075105_525311_C4D96E4F X-CRM114-Status: GOOD ( 11.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ohad@wizery.com, kernel@stlinux.com, loic.pallardy@st.com, linux-remoteproc@vger.kernel.org, patrice.chotard@st.com, bjorn.andersson@linaro.org, ssantosh@kernel.org, ludovic.barre@st.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP remoteproc: core: Move of_get_rproc() helper to header Since of_get_rproc() has been made a simple helper, we can move it to the remoteproc.h and make it a 'static inline'. Suggested-by: Suman Anna Signed-off-by: Lee Jones diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 1c5d5d8..6966fb2 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1267,25 +1267,6 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name) return of_get_rproc_by_index(np, index); } EXPORT_SYMBOL(of_get_rproc_by_name); - -/** - * of_get_rproc() - lookup and obtain a reference to an rproc - * @np: node to search for rproc - * - * Finds an rproc handle using the default remote processor's phandle, - * and then returns a handle to the rproc. - * - * This function increments the remote processor's refcount, so always - * use rproc_put() to decrement it back once rproc isn't needed anymore. - * - * Returns a pointer to the rproc struct on success or an appropriate error - * code otherwise. - */ -struct rproc *of_get_rproc(struct device_node *np) -{ - return of_get_rproc_by_index(np, 0); -} -EXPORT_SYMBOL(of_get_rproc); #endif /** diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 0e1adc9..ec1cffd 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -515,7 +515,6 @@ extern struct rproc *of_get_rproc_by_index(struct device_node *np, int index); extern struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name); -extern struct rproc *of_get_rproc(struct device_node *np); #else static inline struct rproc *of_get_rproc_by_index(struct device_node *np, int index) @@ -527,11 +526,24 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name) { return NULL; } -static inline -struct rproc *of_get_rproc(struct device_node *np) +#endif /* CONFIG_OF */ + +/** + * of_get_rproc() - lookup and obtain a reference to an rproc + * @np: node to search for rproc + * + * Finds an rproc handle using the default remote processor's phandle, + * and then returns a handle to the rproc. + * + * This function increments the remote processor's refcount, so always + * use rproc_put() to decrement it back once rproc isn't needed anymore. + * + * Returns a pointer to the rproc struct on success or an appropriate error + * code otherwise. + */ +static inline struct rproc *of_get_rproc(struct device_node *np) { - return NULL; + return of_get_rproc_by_index(np, 0); } -#endif /* CONFIG_OF */ #endif /* REMOTEPROC_H */