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: 74022 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2046101qga; Tue, 16 Aug 2016 07:50:46 -0700 (PDT) X-Received: by 10.66.242.166 with SMTP id wr6mr578508pac.147.1471359046356; Tue, 16 Aug 2016 07:50:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si32416855pag.32.2016.08.16.07.50.46; Tue, 16 Aug 2016 07:50:46 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932172AbcHPOun (ORCPT + 27 others); Tue, 16 Aug 2016 10:50:43 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:37388 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752411AbcHPOum (ORCPT ); Tue, 16 Aug 2016 10:50:42 -0400 Received: by mail-wm0-f48.google.com with SMTP id i5so173167703wmg.0 for ; Tue, 16 Aug 2016 07:50:41 -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=C3e2ozP7vOPTkqjMqvBQR5xgGIHbtw7QD6QqiBj8gT9gl0nQ/dtkk4LK6/qeQH5cke kUqgRoLwXQHfMNL9oikRzk3RGFG66ZvcpsA7XIjDblLOHSvDGr0ZBCQsmGtxCBemtcxk /WkSYMYs9UsaVPAWF4kV5xU+vOwDq8BG01ViB9+p91QdLOvsq3kdt+iT/3uccz4y0UgD PgIC409SmM83ChlBBEtEfGYKUmjFUFO+ImyLCiK5ezXqDU9oiSa4ezyJC9Hj2Md2fY77 TaZzdWSKJQqWbEr0WbMB7j4oTDF4COegxsPVAmV0lKY82VR73DJBBqYVXquP4RG42yeu XOEA== X-Gm-Message-State: AEkooutjxECYxog3FIH4VY7QqZvM8oR5uoP/B0YvE4SyAMfVteOrwcmF6XM2ap8ITA8DvKuV 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 Cc: kernel@stlinux.com, patrice.chotard@st.com, ohad@wizery.com, bjorn.andersson@linaro.org, ssantosh@kernel.org, linux-remoteproc@vger.kernel.org, ludovic.barre@st.com, s-anna@ti.com, loic.pallardy@st.com 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */