From patchwork Tue May 9 19:47:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 98950 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1991296qge; Tue, 9 May 2017 12:47:11 -0700 (PDT) X-Received: by 10.98.99.135 with SMTP id x129mr1888071pfb.4.1494359231680; Tue, 09 May 2017 12:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494359231; cv=none; d=google.com; s=arc-20160816; b=0sn0KSwqkik/PJ/L9eZuEltgSEaOXuDbth93g8IFODYmTDXIPGMEfHeZ1NcjxsO+DX GXEIBgrXWO0VWY7KBqJ/MbG3cNX5Kii8QpyTrNBsnm3KEoxMkgsOtOl9/YEzC3tXmr8Y wmrRkKCqEIMOnk4cMHyuCLAoAJT0s34shDixX4htxBpf3/DBmhcmOasxgfkbYpymhxZB RU9fkvgNOgfdK1amkWGhe7/sSpZMyXEwEbgHI7OGF0A7Lj555+vhyzLyV4qZwWe4tfoi N1JMwvrSmfRYbXCx8jwQFBkfzZDNUHQfuNHmE3wixgHEjAPSnXjCT5u+6KJXj8DnSHKL WXHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=XpTUwuJcddZLfZ1W2hMeppUqi9zkBNj8tJSHplkB57M=; b=HKUt5XLirNB+3AH0XdIBzrY9DNrmcKsPHht74zMvHGiJZkP+2lQcNOn2czdOx9XxG4 0SQRu+Y/JITONWFtJMT4dlFiwdOjXp/fyJV5Qh+ac3/6i29M8Au593/2vF8rAr23QI3Z fn9qcChQfI/mmeWtdBNCwlRpByM6PNaM1qb6UKWZTEycOilTEGrL1uuRX90m5Q69Tr6C +BgblzfqWYMYf5aK1DR2u4NYDtT4SpSpn7BZ7ClhAdM63q0n1jGLii/V97AjsBt7xLWM EWPI9d569yrevrh2e+NuRcB32I3/TrhOJ6ZRxsQoXww6pcQL/w7Dyf3XlkmwaSwcdSnJ 9F1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 s1si782432plk.256.2017.05.09.12.47.11; Tue, 09 May 2017 12:47:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbdEITrJ (ORCPT + 10 others); Tue, 9 May 2017 15:47:09 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:32932 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbdEITrH (ORCPT ); Tue, 9 May 2017 15:47:07 -0400 Received: by mail-pf0-f171.google.com with SMTP id e193so4886115pfh.0 for ; Tue, 09 May 2017 12:47:07 -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; bh=cEi8+Jl6iNDGofGmbIe6OF07yQY6y5Qg9jH+8cOLDJc=; b=g5PmkQ0I1xzLwY3h0RD7FVUwfRdjxdQPbzjEFQ2+i7swLRjCdOaAjhpddHlJUnVgeh BtHm18m8uekyKAMcQp5XEoctYIsaysJVYyRh+YVd/v5tbDAPKiP5KRd+yJuusrBOREp9 1ZEmecJXJ/531n+yF//T6+TSZjhtB9bEyUrJc= 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; bh=cEi8+Jl6iNDGofGmbIe6OF07yQY6y5Qg9jH+8cOLDJc=; b=r2ACGL/JLaUahN63R3OaC1qhDxhGyRa3ayVObZdqVaXmk+LvmKoc+T0KwlW3V0jiGG 7MgRuI7OUCustpbc0wpg50UGfyebvjcUQktL7g9gegIbeRhPeUndW7EvWh31zHWGv+8E bMiZhp60KDK21R6Mw/hQANqDDD0XOwbzbRmXtwyy0UyIeoOM7ziOzOcPMJ4LTVbB6bok gHk2S/8QeBLT5+L7LeRzrAYVDEO6If/8zfP9NIXkzprqUvWxFQvEgm9wwn8d7cHoG6AB SWEXT9yYsAGtU8vgPrHBMU/UyK1jjdyFS/YjEQm/KQXjcSlJ42Bq3KSp6KxdQRozfoTD ki0A== X-Gm-Message-State: AODbwcAsg131+711DXfFF4ikz+bgC0rPowkRqynqPbh8GwGG47g39CkP spUMqZP52tKURiYM X-Received: by 10.99.149.94 with SMTP id t30mr2090067pgn.152.1494359227073; Tue, 09 May 2017 12:47:07 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id x2sm1279236pfi.80.2017.05.09.12.47.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 12:47:06 -0700 (PDT) From: Bjorn Andersson To: Jassi Brar Cc: Rob Herring , Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Subject: [PATCH v6 1/4] mailbox: Make startup and shutdown ops optional Date: Tue, 9 May 2017 12:47:00 -0700 Message-Id: <20170509194703.28871-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Some mailbox hardware doesn't have to perform any additional operations on startup of shutdown, so make these optional. Signed-off-by: Bjorn Andersson --- Changes since v5: - None drivers/mailbox/mailbox.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 4671f8a12872..505651ce9dcc 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -352,11 +352,14 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index) spin_unlock_irqrestore(&chan->lock, flags); - ret = chan->mbox->ops->startup(chan); - if (ret) { - dev_err(dev, "Unable to startup the chan (%d)\n", ret); - mbox_free_channel(chan); - chan = ERR_PTR(ret); + if (chan->mbox->ops->startup) { + ret = chan->mbox->ops->startup(chan); + + if (ret) { + dev_err(dev, "Unable to startup the chan (%d)\n", ret); + mbox_free_channel(chan); + chan = ERR_PTR(ret); + } } mutex_unlock(&con_mutex); @@ -405,7 +408,8 @@ void mbox_free_channel(struct mbox_chan *chan) if (!chan || !chan->cl) return; - chan->mbox->ops->shutdown(chan); + if (chan->mbox->ops->shutdown) + chan->mbox->ops->shutdown(chan); /* The queued TX requests are simply aborted, no callbacks are made */ spin_lock_irqsave(&chan->lock, flags);