[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 5 May 2017 16:03:31 +0530
From: Jassi Brar <jassisinghbrar@...il.com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Andy Gross <andy.gross@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Ohad Ben-Cohen <ohad@...ery.com>,
linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
Devicetree List <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-remoteproc@...r.kernel.org
Subject: Re: [PATCH v4 1/5] mailbox: Make startup and shutdown ops optional
On Fri, May 5, 2017 at 1:35 AM, Bjorn Andersson
<bjorn.andersson@...aro.org> wrote:
> Some mailbox hardware doesn't have to perform any additional operations
> on startup of shutdown, so make these optional.
>
Thanks, makes sense.
> 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.
Powered by blists - more mailing lists