diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-07 10:24:07 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-07 10:24:07 -0700 |
| commit | 21c19bc7ee256094aba74af8d91a824da4bc36af (patch) | |
| tree | 85c058588fc097fe6fd0f00caa200c7bd5ed658e /drivers/mailbox/mailbox.c | |
| parent | b6ffe9ba46016f8351896ccee33bebcd0e5ea7c0 (diff) | |
| parent | 25bfee16d5a3158086273cc51110c7470144c842 (diff) | |
Merge branch 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration
Pull mailbox updates from Jassi Brar:
- Minor improvement : avoid requiring unnecessary startup/shutdown
callback that many drivers seem to not need
- New controller driver for Qualcomm's APCS IPC
* 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
mailbox: Introduce Qualcomm APCS IPC driver
dt-bindings: mailbox: Introduce Qualcomm APCS global binding
mailbox: Make startup and shutdown ops optional
Diffstat (limited to 'drivers/mailbox/mailbox.c')
| -rw-r--r-- | drivers/mailbox/mailbox.c | 16 |
1 files changed, 10 insertions, 6 deletions
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); |
