From patchwork Sat May 27 23:14:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 100606 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp839981qge; Sat, 27 May 2017 16:14:32 -0700 (PDT) X-Received: by 10.99.175.18 with SMTP id w18mr10560437pge.183.1495926872716; Sat, 27 May 2017 16:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495926872; cv=none; d=google.com; s=arc-20160816; b=gd2H2A55kYxYlBoegZI9mRtOdzzwF3z6uTqlMjQnV8BV3TdaD+fKPnMfmZ2oCMpZ1n /Y/iuQvofoyRCrWK36MJE5e2+86TSH/FiIK0aTrLhZuX6HaBEBPDK+4bGpV7L7dkkyNC 0lcocI7GcUYrDPs+Q6ZqmdaR7OaaMVGOPZJbap2eQkpa8IVWH+Nz5foNvK6VFrZwbHN5 rg5gnQp31UyKbjuAiDiQ3CIE6EDwXJxChPh57b7xhLlccPihWF+V18RGQ7g1cA/5wEHx nzwTBAeU1t3WIxcIn1CMDPLJatHSvmOB5MCQfuoPG66dv5XjLHcUgqaBdfCBwJaxs+1u WQwA== 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=4R2UhSMaF64Nn4bPQexxM5cgcRONfeDWL9JQ75GGch0=; b=WeK9W5t2KYl00oW9IlSNefQtFX4n1zOAn5Vr2XyIiRMYazuZYh1LSaITuNl7/+zp81 b+9HIMiJnv15Lk7nkWg3JpFfzsTK0cgxJTv8awYghjwEb8uXuuQU9nSXH6yt7XBy67o6 G32TnnW+LGjGRnE4yk7L3TACrhGxGeYZhDZ8M1Cr4FsNRXh7dt6D3wSsB4BFKSue8zaD VAjgsOJV8LOWtpNAO7CRGU0KgHwSRkVfXyfJM+veiUQfqeXa3b+616KxemEZMImr7izF IywLMxJbVqGThf7ZLLY13qdBMGZjdqdqEgwzzLKegqEDQQaxv5bsDdqDw5ro+5RRkJsW k+MA== 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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 28si5484132pfq.323.2017.05.27.16.14.32; Sat, 27 May 2017 16:14:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1750768AbdE0XOL (ORCPT + 7 others); Sat, 27 May 2017 19:14:11 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:35701 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750751AbdE0XOK (ORCPT ); Sat, 27 May 2017 19:14:10 -0400 Received: by mail-pg0-f51.google.com with SMTP id 8so8246928pgc.2 for ; Sat, 27 May 2017 16:14:09 -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=9IEiSKNlADtvky2nLq1QWxHbMMx7NDVdh0xHQ0NVerw=; b=CrsDulRWszv4mrZ7U3punWRYtZCGjDA/05vlgdyi722N1jF60LdTXfGpk6UfPsmHhp it+0AR31XLoP8n0eVg4RfCEacBbyX5hM6+DSbyxkEJaPGRZx0NgrRqN9WqnJUj1CponP 2rJEvniD1GGy121bMlbSlYwKsA/YH4I7jBMjQ= 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=9IEiSKNlADtvky2nLq1QWxHbMMx7NDVdh0xHQ0NVerw=; b=PekG53NbjA0UT1tdmp3PBrWyDEZoJSdyAjq7v108TdoCc/kBHDejlKU0G4SwB/e/sL Ef4/74IbUETcNKjjjd2VVZarpqOImSFyaYP0+E64kIt+SZNXy5jseL0QyndI8d0rMGZS 8UhnOFAFW+qTmnuzzbXnn/V5AEdOacOh0o4x0xjPdyrcIREeXLXq9PwNiIKfkQD9RjPE ltnXFp8uxo3UyoHzAbzFfM/xl73d5KR9IrYJvnnZbFjINOPx80b0lFNPbPYqnjD6jNo5 x1PRHGvwD2k046l4XprCOAKLCcrTPmLGRq8iTMNrIusA92OBjMeAtDksLpKdoKt9tKwZ xQ8A== X-Gm-Message-State: AODbwcBWPd0YcmJAN88CYj12bbHI6fNOOxHeBkxEICQBkJZVS0nFf0Oa V+hE1NBuXSjZQsJM X-Received: by 10.98.103.87 with SMTP id b84mr10136823pfc.235.1495926849275; Sat, 27 May 2017 16:14:09 -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 c67sm10070255pfe.37.2017.05.27.16.14.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2017 16:14:08 -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 Subject: [PATCH v7 1/3] mailbox: Make startup and shutdown ops optional Date: Sat, 27 May 2017 16:14:02 -0700 Message-Id: <20170527231404.7632-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 v6: - 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 devicetree" 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 9dfbf7ea10a2..537f4f6d009b 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -355,11 +355,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); @@ -408,7 +411,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);