Thread (28 messages) 28 messages, 5 authors, 2017-05-16

Re: [PATCH v4 1/5] mailbox: Make startup and shutdown ops optional

From: Jassi Brar <hidden>
Date: 2017-05-05 10:33:36
Also in: linux-arm-msm, linux-remoteproc, lkml

On Fri, May 5, 2017 at 1:35 AM, Bjorn Andersson
[off-list ref] wrote:
Some mailbox hardware doesn't have to perform any additional operations
on startup of shutdown, so make these optional.
Thanks, makes sense.
quoted hunk ↗ jump to hunk
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 4671f8a12872..c88de953394a 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -137,6 +137,20 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer)
        return HRTIMER_NORESTART;
 }

+static int mbox_startup(struct mbox_chan *chan)
+{
+       if (chan->mbox->ops->startup)
+               return chan->mbox->ops->startup(chan);
+
+       return 0;
+}
+
+static void mbox_shutdown(struct mbox_chan *chan)
+{
+       if (chan->mbox->ops->shutdown)
+               chan->mbox->ops->shutdown(chan);
+}
+
These functions are going to be called from exactly one place. So
maybe we simply do the check before startup/shutdown calls?

thanks.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help