From patchwork Tue May 15 20:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 10401989 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 BBBF1601F7 for ; Tue, 15 May 2018 20:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A909C285ED for ; Tue, 15 May 2018 20:55:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D152285F1; Tue, 15 May 2018 20:55:08 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BC35285ED for ; Tue, 15 May 2018 20:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752774AbeEOUy5 (ORCPT ); Tue, 15 May 2018 16:54:57 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:53172 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500AbeEOUxz (ORCPT ); Tue, 15 May 2018 16:53:55 -0400 Received: by mail-it0-f68.google.com with SMTP id y189-v6so5083622itb.2 for ; Tue, 15 May 2018 13:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AQYVmhhhEfZe5pYonBXHye7W95XGf11qK5LrAzFs7q0=; b=PxgALhHWxDZoyqTTedczpzdBvIUvq0OkDzMVemVINKduHlyY3wKYjwSL3mGEqtN8hf JlWuyoOtOhPnwCFrf6u+dht1ctwRKaD+sCxSBXKZUT79jeGMFOyRRX6pW+dhYtv/Zn93 6T6+F5YI/i/PrKSx9go5sAQkr3FeGwE0B6pTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AQYVmhhhEfZe5pYonBXHye7W95XGf11qK5LrAzFs7q0=; b=Sqc2O/p8Ry8qpbd/XGkJM/7O8WC1AgH5dvuOjIMjABhj5uXjp4KkZZh9dAOVUfe7J3 9BDR6fwM0XRylDkEu/IZWb3zUrp5jF4gqksviIZRpcf2hV9+KSCtPHytCmsfpVaguIIG +txZ0JBDl67QVsgCeyNQSlLtlwuvKsaGBg4v6PHMe9aeSNwxFOkc/NnHREKdC3UwkSA8 yDCd7c9vmQTJIYLkUriX12hX90N1/V+aLdl8XbndhQyTNSy0zvjpO5KbOY2JxhLj0I4K BdtdEsE2y56zArasUJEHoV2Z5yNk1BPRTurGJu5uGasNe5wY+crzqJc211km8pF+V3py /qRA== X-Gm-Message-State: ALKqPwdDliVnnQyMo78j6GBw3KROkWZ7ohHChXp7Hzn/MPwkU3JHkQ9n qYqngeGdBZCllejXQwg++zXEkLa28SU= X-Google-Smtp-Source: AB8JxZog3jlyDHh5Df1yvcW0duzqhfivtiOu/Kdgw8LtXfNshKN24jhKY15hoUJzZBpyryHcX1sVUA== X-Received: by 2002:a6b:89e0:: with SMTP id t93-v6mr16668777ioi.230.1526417635066; Tue, 15 May 2018 13:53:55 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id t9-v6sm440407ioa.82.2018.05.15.13.53.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 13:53:54 -0700 (PDT) From: Alex Elder To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] remoteproc: Rename subdev functions to start/stop Date: Tue, 15 May 2018 15:53:41 -0500 Message-Id: <20180515205345.8090-2-elder@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515205345.8090-1-elder@linaro.org> References: <20180515205345.8090-1-elder@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bjorn Andersson "start" and "stop" are more suitable names for how these two operations are used, and they fit better with the upcoming introduction of two additional operations in the struct. [elder@linaro.org: minor comment edits] Signed-off-by: Bjorn Andersson Acked-by: Alex Elder --- drivers/remoteproc/remoteproc_core.c | 30 ++++++++++++++-------------- include/linux/remoteproc.h | 14 ++++++------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index a9609d971f7f..5dd58e6bea88 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -774,13 +774,13 @@ static int rproc_handle_resources(struct rproc *rproc, return ret; } -static int rproc_probe_subdevices(struct rproc *rproc) +static int rproc_start_subdevices(struct rproc *rproc) { struct rproc_subdev *subdev; int ret; list_for_each_entry(subdev, &rproc->subdevs, node) { - ret = subdev->probe(subdev); + ret = subdev->start(subdev); if (ret) goto unroll_registration; } @@ -789,17 +789,17 @@ static int rproc_probe_subdevices(struct rproc *rproc) unroll_registration: list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) - subdev->remove(subdev, true); + subdev->stop(subdev, true); return ret; } -static void rproc_remove_subdevices(struct rproc *rproc, bool crashed) +static void rproc_stop_subdevices(struct rproc *rproc, bool crashed) { struct rproc_subdev *subdev; list_for_each_entry_reverse(subdev, &rproc->subdevs, node) - subdev->remove(subdev, crashed); + subdev->stop(subdev, crashed); } /** @@ -901,8 +901,8 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw) return ret; } - /* probe any subdevices for the remote processor */ - ret = rproc_probe_subdevices(rproc); + /* Start any subdevices for the remote processor */ + ret = rproc_start_subdevices(rproc); if (ret) { dev_err(dev, "failed to probe subdevices for %s: %d\n", rproc->name, ret); @@ -1014,8 +1014,8 @@ static int rproc_stop(struct rproc *rproc, bool crashed) struct device *dev = &rproc->dev; int ret; - /* remove any subdevices for the remote processor */ - rproc_remove_subdevices(rproc, crashed); + /* Stop any subdevices for the remote processor */ + rproc_stop_subdevices(rproc, crashed); /* the installed resource table is no longer accessible */ rproc->table_ptr = rproc->cached_table; @@ -1657,16 +1657,16 @@ EXPORT_SYMBOL(rproc_del); * rproc_add_subdev() - add a subdevice to a remoteproc * @rproc: rproc handle to add the subdevice to * @subdev: subdev handle to register - * @probe: function to call when the rproc boots - * @remove: function to call when the rproc shuts down + * @start: function to call after the rproc is started + * @stop: function to call before the rproc is stopped */ void rproc_add_subdev(struct rproc *rproc, struct rproc_subdev *subdev, - int (*probe)(struct rproc_subdev *subdev), - void (*remove)(struct rproc_subdev *subdev, bool crashed)) + int (*start)(struct rproc_subdev *subdev), + void (*stop)(struct rproc_subdev *subdev, bool crashed)) { - subdev->probe = probe; - subdev->remove = remove; + subdev->start = start; + subdev->stop = stop; list_add_tail(&subdev->node, &rproc->subdevs); } diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index dfdaede9139e..bf55bf2a5ee1 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -477,15 +477,15 @@ struct rproc { /** * struct rproc_subdev - subdevice tied to a remoteproc * @node: list node related to the rproc subdevs list - * @probe: probe function, called as the rproc is started - * @remove: remove function, called as the rproc is being stopped, the @crashed - * parameter indicates if this originates from the a recovery + * @start: start function, called after the rproc has been started + * @stop: stop function, called before the rproc is stopped; the @crashed + * parameter indicates if this originates from a recovery */ struct rproc_subdev { struct list_head node; - int (*probe)(struct rproc_subdev *subdev); - void (*remove)(struct rproc_subdev *subdev, bool crashed); + int (*start)(struct rproc_subdev *subdev); + void (*stop)(struct rproc_subdev *subdev, bool crashed); }; /* we currently support only two vrings per rvdev */ @@ -568,8 +568,8 @@ static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev) void rproc_add_subdev(struct rproc *rproc, struct rproc_subdev *subdev, - int (*probe)(struct rproc_subdev *subdev), - void (*remove)(struct rproc_subdev *subdev, bool crashed)); + int (*start)(struct rproc_subdev *subdev), + void (*stop)(struct rproc_subdev *subdev, bool crashed)); void rproc_remove_subdev(struct rproc *rproc, struct rproc_subdev *subdev);