mailbox: Remove const from client argument of mbox_request_channel()
authorMark Brown <broonie@linaro.org>
Fri, 13 Jun 2014 20:40:45 +0000 (21:40 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 13 Jun 2014 20:50:25 +0000 (21:50 +0100)
The struct mbox_client supplied to mbox_request_channel() is const but
it is stored in the channel in a non-constant member causing compiler
warnings.

While the mailbox API should treat the struct mailbox_client as const
itself the struct is passed back to the channel in callbacks without
a const so we need to either remove the const, change the callbacks to
take const or cast the const away when doing callbacks. Take the simplest
option and just remove the const.

Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/mailbox/mailbox.c
include/linux/mailbox_client.h

index e1fc6aaeb87c1045db18e499b4457fe4cefbb92a..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;
index cbfcf8478ca963bdbdae12f362eb9e4711eb5bdb..955f3d7641e828e904ae84f35dcb2bbb16594837 100644 (file)
@@ -37,7 +37,7 @@ struct mbox_client {
        bool knows_txdone;
 };
 
-struct mbox_chan *mbox_request_channel(const struct mbox_client *cl);
+struct mbox_chan *mbox_request_channel(struct mbox_client *cl);
 int mbox_send_message(struct mbox_chan *chan, void *mssg);
 void mbox_client_txdone(struct mbox_chan *chan, int r);
 bool mbox_client_peek_data(struct mbox_chan *chan);