From patchwork Tue Jun 26 12:11:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 139976 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5161987lji; Tue, 26 Jun 2018 05:12:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIj0XgxNrKZsb1EFxRzLHJ85jLeI7mY6K8qryrd6bs2qN4itAvxPkXaHMRU9bBBfulFwDuq X-Received: by 2002:a17:902:70ca:: with SMTP id l10-v6mr1378842plt.174.1530015138707; Tue, 26 Jun 2018 05:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530015138; cv=none; d=google.com; s=arc-20160816; b=GsyPt5JEgXEx8y+PB+pjNXj3JDwKmStQ3tg6aeiHK2hi5ng5pq72TuZnoEGNPFMFii VNy4jexIznMPE5nIZ/FrAPD1znVdJjh3GhjPWXtfegvhvvJUJ0mwGGkzBMMVOPBeh3YI Uzs8NQky66J4SMoljxQgKB5D/Z6SgN6H8J7IJZ48MuKAv6i3Zva2Qo2t+m8F65ySZ5dW S/MWkRtkT4L9BkZ5vUTNpL6IOjqI3AC519A8JlRWm9sln3readmObW6z4ypiDhM1D3dM gizY9MFplIjkouDzgZrMF2/k9DOU+Tl6gTl7HL0c2SN/0cihdPqfOcd0llO47MsaiYvn HQmw== 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=KUWr3sUam7AxtX0IcmLHuD9btenxzAh1xvCRgQlImR0=; b=jVvvjIgeBACk7hECKry9EXNxyvrKYoR/Ef/qXxRKQK6ZJ/TC2N/ccRHJvnjldJylP3 bXcR2uC7h/7P8AAb6fZatmU5QgqDaRBy3fw1Owpa64dEKB2wpbarkrxO+s2QOicEaiVp /uVoRiMbde/s9mXvXNKxXrpDGKWUjKnT5dKgn+cO2CSVU5fwFCrC9MC7R03xsJW71hO9 lp/28PIRlEf5+QuMhhrM4mUp0PwfjAMT0Q3kkJ8i1j7/cZtuTQTh6kuwsCLPLL1qRFSE RtQQHS9F+H2k51bVfXNnUUAHgG6Jz3hwMBgpHYdLE6UGk8iZJtXNiyb9g3vd4vOaJoOQ o5TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvwOA5v8; 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 cf13-v6si1760748plb.175.2018.06.26.05.12.18; Tue, 26 Jun 2018 05:12:18 -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=fvwOA5v8; 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 S935324AbeFZMMQ (ORCPT + 31 others); Tue, 26 Jun 2018 08:12:16 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:36533 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935251AbeFZMML (ORCPT ); Tue, 26 Jun 2018 08:12:11 -0400 Received: by mail-io0-f194.google.com with SMTP id k3-v6so15758533iog.3 for ; Tue, 26 Jun 2018 05:12:10 -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=KUWr3sUam7AxtX0IcmLHuD9btenxzAh1xvCRgQlImR0=; b=fvwOA5v8tpw0xv0m35CcoOsJWbPOnvkn1SCUOX4abcUGDAMYuGm2ZE3CK+R8ayXMrF V8xaTHYtThBspjtLcMHb58wjnRGwbzWJkjZuqZRXXZ2a1iDn9xzGvqW9iVL9HiTkC8m/ CWCniReO3bTFntgEID4TEXsjaAK8VS1RYHR2A= 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=KUWr3sUam7AxtX0IcmLHuD9btenxzAh1xvCRgQlImR0=; b=RTY+/guiN4kqYz9UkTDk8//KxIvF6RptiSZgAzEjAidLonNXNBHFfPo0hHVvXB+Jfe izD6sDP6a4YcSqKT5bR404W1odB69DLATvedXcboalaukYjZ+ryz7oSUe9u0Gi5cvwZA 4Hc6SOoj0wG9+krP/sqsm1rbDxoS2XweaAriLiGEmEcqzmIsi0lY/jAnHsZwDd0gKHq3 Wja4Ptp87RqCG6OBCOcVb1IrK/CpbdXNCPV0Kfdq/Mw1QKEc0OyPDbntvePWJ9tBP9ew gmWEtVneIe3NQKFLU3gFtsnOkB70eXrOALyO6t+Sp7hJicThtm+u0YaPvU/oeY+EkaqL 8Taw== X-Gm-Message-State: APt69E0iDkAKfpUT/GSnaatgwrhSPwwDIrH4mXyKlhGlL2gKb18DG8UC /V3ByYjEm8wG7wMh99lzydSxeg== X-Received: by 2002:a6b:bd43:: with SMTP id n64-v6mr1041947iof.254.1530015130282; Tue, 26 Jun 2018 05:12:10 -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 y62-v6sm902309ioy.88.2018.06.26.05.12.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 05:12:09 -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 v2 1/5] remoteproc: Rename subdev functions to start/stop Date: Tue, 26 Jun 2018 07:11:55 -0500 Message-Id: <20180626121159.7267-2-elder@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626121159.7267-1-elder@linaro.org> References: <20180626121159.7267-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. Tested-by: Fabien Dessenne Signed-off-by: Bjorn Andersson [elder@linaro.org: minor comment edits] Signed-off-by Alex Elder --- drivers/remoteproc/remoteproc_core.c | 30 ++++++++++++++-------------- include/linux/remoteproc.h | 14 ++++++------- 2 files changed, 22 insertions(+), 22 deletions(-) -- 2.17.1 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);