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: 135933 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp28529lji; Tue, 15 May 2018 13:55:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqSwSIBmkAcl43YR1aItTUkVLSAL8xg8i3lGAtanLstKRZPMKJGBvq5NJ1kE3ECY8Ssnq6l X-Received: by 2002:a62:1e02:: with SMTP id e2-v6mr16783173pfe.212.1526417699881; Tue, 15 May 2018 13:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526417699; cv=none; d=google.com; s=arc-20160816; b=HQ91M2Laijr84ThPRnhy5/CEteSCdQPFNvR3MJAJBc63gVXhrPBBCRIoutOmNB0QxE wHZAxQtId4QRBd/x2b6anOkkhVL+cUG56USV9roH1daaJSCovUdgwouWIn3kgo6Mt94V gu7/vlPb2L3M3dmZBmzzWKye/nBB4eP8yks76x2P7VOJdh6X2kppx+ZB/yK+xf5mM+4m F5zxFrXT9GQmk1snm62jhE+YsxSwlCItrGBbiSRfcyqBoDvPhV8dPlyTPASqSDlI4PfE GbbZZxNlF4eN3l8jwW3zZiVUypTy2/TaOXNNdY4dIeqQU2ZAB3IdiJOZB9T6hXo64EGo 2sYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=AQYVmhhhEfZe5pYonBXHye7W95XGf11qK5LrAzFs7q0=; b=fon9zaLBLuVXem9yWfwNG/R9jpngPbJKMA0XIvdvgh/DlmlT9KFRNgaBgO2barieMb XGNNbAIRivQTgxrYXZXbbQXZ0V3QmX/8oxN2kfr6mBUSuDVTEDBmCUKgkHcwaNl2IfSF w9/yA4myYMTyVvxI8SaWlMKfrkhA1xgI/jYoSvsFBiMu+jDNh2+8QKpqyD3YtkUEltQl ReF+NYFAJYjtRWVhF3bzdZbpnWa5wV1xR3P9Z7Qr91m62lTo8sG/3yAKWAOLN6eqswVK xNMQAOGRkJJFO94IHyz0R0tF1VV13iNgGheBsDmqu6x9HDcQILLDE7XTB2VuJOZtA+bp Z1hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PxgALhHW; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l187-v6si753216pge.46.2018.05.15.13.54.59; Tue, 15 May 2018 13:54:59 -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 header.s=google header.b=PxgALhHW; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752803AbeEOUy5 (ORCPT + 29 others); Tue, 15 May 2018 16:54:57 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:51785 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752518AbeEOUxz (ORCPT ); Tue, 15 May 2018 16:53:55 -0400 Received: by mail-it0-f66.google.com with SMTP id n202-v6so5093108ita.1 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=kqjvUk8hd2Thoj0atqLsCNCUkKDyLW+BFmvRBdoegTAPamw8bla27FnzGth4h0CPgA blD3Bdoqp/Q40LlJwQMlDL7fKinIEIcZH2X2p1ehLBBQbwWaB2t+5Oa/YBn8ZnRU7f3n Skg5oL6fLQcDhMVnKI7foOjT4Br5CSNyrgn+I/FQXhu0MNa94ZjKvxr62dY3vnoWjnzq ow8B2RzWqVRmeBOZ8EEf+4suFu2Q0nAfJB7q8DJiAZQNP0iUITPWkCoKSqO+A/Hc+cSJ 87feBLBShfD14iyDSVnjTEymrZypxqUqsPPM1et/1wbhup92S5jhpwUigYh7gbhFrdw8 6vVA== X-Gm-Message-State: ALKqPwdt1NHf8oHgB52wQhUzGpOGjOQk4LEpGk2PXpD1cyhIrS+k0Rcb BWLI9ELLmcVWnI9/8BI6IpkhcQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.0 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);