pwm: enable pwm-frequrency less than 1K
[firefly-linux-kernel-4.4.55.git] / drivers / mailbox / mailbox.c
index 9d356ba77edf0a4a2a818686de2b666e468109c0..607dd91e87a16b9a851ce103ece8a30a30c3b2ba 100644 (file)
@@ -294,7 +294,7 @@ EXPORT_SYMBOL_GPL(mbox_send_message);
  * Return: Pointer to the channel assigned to the client if successful.
  *             ERR_PTR for request failure.
  */
-struct mbox_chan *mbox_request_channel(const struct mbox_client *cl)
+struct mbox_chan *mbox_request_channel(struct mbox_client *cl)
 {
        struct device *dev = cl->dev;
        struct mbox_controller *mbox;
@@ -480,7 +480,8 @@ void mbox_controller_unregister(struct mbox_controller *mbox)
        for (i = 0; i < mbox->num_chans; i++)
                mbox_free_channel(&mbox->chans[i]);
 
-       del_timer_sync(&mbox->poll);
+       if (mbox->txdone_poll)
+               del_timer_sync(&mbox->poll);
 
        mutex_unlock(&con_mutex);
 }