From patchwork Tue Jun 26 01:34:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 139908 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4639103lji; Mon, 25 Jun 2018 18:34:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKkU3kfGGzeSItjgOIZ2jUA9JRX+ISukmBawXOMuu9GCy7L5GfETd44H/ZBbkxij1/qLkQD X-Received: by 2002:a63:b256:: with SMTP id t22-v6mr12924503pgo.101.1529976861464; Mon, 25 Jun 2018 18:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529976861; cv=none; d=google.com; s=arc-20160816; b=XxW9p/Yf0Svc/3SpihMyLZaNjbRwN0YYtldjGBANZrqmZ6Y4Wcdhs9+6D1Caxumw8q S8ZG+Oskkn0mvrcT/pQMZobk53B5CJezXYdk7EELY07z6DmjlY76wG8xNsU315liaUj7 o5PimDf5Lr59cSyAAAT9txZU3ygZVa9lHVx0qkziuTQp8wMa/GUHWUcAImF0bwvGgP7c ZsflgA/7VOEzEQGrcctrmpoqQyHxUVr56OTO1JPFwJ2hwJipJ/6eZfMEQHwBReacltb0 1AFFpjnHtedrVGtD3xulI7oK2qAwYvA6tAsB/Py7R4iLL6jaQsvKdrKZXPYYBHcBobsn GGBQ== 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=kEKesqqo+/X5Y1TJjKx05ALvbSOA18VpVMYr5WHzjvY=; b=O4/mIvJOaLrQ61F0f8jEj5D8fJ4Nti4VcV3EGVje9UXN5cUv3H1f/Rpc0JXlb9cpJi /A06hELrKiWeDoJY7f13CieaPd+3EpevinyUKSx5OmjeRlDG7zjghkY3LOF8GOD3MldR fm+xMEMW/5ThOZoDxcKYvJn+GhfRjCkjD7c7NBXeA1H4zO5GzBqe+SgRjyOFxP6YjUYR H+p4SY4z3TwnioTAFNGFEj5fBOYkHBwLuX1uEHZXqf1i11vs1SRuF1jaxbuAuf51q8pL 9/GFDSL7X1uQ63eCpuihxLlcSoYiBqNFBrcmpAOvfKUtYIwezqkgpPzroXWvUoQ16DKw sZ2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U3W6PbxJ; 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 c81-v6si409489pfj.138.2018.06.25.18.34.21; Mon, 25 Jun 2018 18:34:21 -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=U3W6PbxJ; 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 S935298AbeFZBeS (ORCPT + 31 others); Mon, 25 Jun 2018 21:34:18 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:38468 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935132AbeFZBeO (ORCPT ); Mon, 25 Jun 2018 21:34:14 -0400 Received: by mail-it0-f65.google.com with SMTP id v83-v6so15180698itc.3 for ; Mon, 25 Jun 2018 18:34:14 -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=kEKesqqo+/X5Y1TJjKx05ALvbSOA18VpVMYr5WHzjvY=; b=U3W6PbxJjjMLlWRK/KUHAwp4zTcxydY6ckI2MEkktvhip6QD4rd1bh8wIjQR2cUrO5 cwlPv27/hrOeOnRTf8RfQTw13aFMy0GZeWQ1749Yg8J+EjnO2olrkOvh47VJS6TGUVfa qByDt8iZTsz1cNngVqJwBv1RFgF2PXYkLfXSY= 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=kEKesqqo+/X5Y1TJjKx05ALvbSOA18VpVMYr5WHzjvY=; b=RzVmNOuD7yW8ok35HwGG1S8gfDB4qbj+PVTVt2xSwD+BSdVmiTJ3HOJnGfna9uUGiv vJGmi5u8J6WCBDrh+okL7Rv0AnLydnNLNkaUSxWLE2px9VQXSa2E13XhDnyFlaimrlTw iLbKJ6pBu8OqgH0Cnr9b0gc88QcmUoSu+Q4rgcoAvfo9O7nlDA8ZYzNCNCaVEU6jl8NC l6eO1jyj1VlBz6AaO44/3x7XNCFRfu61gd1BugSXUvPys4K5jiQysk/cev0M+eA5bdyO /auQOqel7D+J4sD57kiEt6VR5ruQIbLVwoKATgtKj11aaMfZ3xrUPoU8UmwhZgxIvX9A YB4Q== X-Gm-Message-State: APt69E1WzxQrKR2mjBULNq7wbFbadjAZ8nUbY+6cUvml7D/ub9p9sXDR 9vlK7cBzYyoQxR0hp/XsdcwFPQ== X-Received: by 2002:a02:a30f:: with SMTP id q15-v6mr9790170jai.66.1529976854238; Mon, 25 Jun 2018 18:34:14 -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 h62-v6sm184699ioa.22.2018.06.25.18.34.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 18:34:13 -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 resend 2/5] remoteproc: Make start and stop in subdev optional Date: Mon, 25 Jun 2018 20:34:06 -0500 Message-Id: <20180626013409.5125-3-elder@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626013409.5125-1-elder@linaro.org> References: <20180626013409.5125-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 Some subdevices, such as glink ssr only care about the stop operation, so make the operations optional to reduce client code. Signed-off-by: Bjorn Andersson Acked-by: Alex Elder Tested-by: Fabien Dessenne --- drivers/remoteproc/remoteproc_core.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 5dd58e6bea88..981ae6dff145 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc) int ret; list_for_each_entry(subdev, &rproc->subdevs, node) { - ret = subdev->start(subdev); - if (ret) - goto unroll_registration; + if (subdev->start) { + ret = subdev->start(subdev); + if (ret) + goto unroll_registration; + } } return 0; unroll_registration: - list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) - subdev->stop(subdev, true); + list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) { + if (subdev->stop) + subdev->stop(subdev, true); + } return ret; } @@ -798,8 +802,10 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed) { struct rproc_subdev *subdev; - list_for_each_entry_reverse(subdev, &rproc->subdevs, node) - subdev->stop(subdev, crashed); + list_for_each_entry_reverse(subdev, &rproc->subdevs, node) { + if (subdev->stop) + subdev->stop(subdev, crashed); + } } /**