Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mailbox: Make mbox_chan_ops const

The mailbox controller's channel ops ought to be read-only. Update
all the mailbox drivers to make their mbox_chan_ops const as well.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Cc: Ley Foon Tan <lftan@altera.com>
Acked-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Andrew Bresticker and committed by
Jassi Brar
05ae7975 59dd3f02

+5 -5
+1 -1
drivers/mailbox/arm_mhu.c
··· 110 110 free_irq(mlink->irq, chan); 111 111 } 112 112 113 - static struct mbox_chan_ops mhu_ops = { 113 + static const struct mbox_chan_ops mhu_ops = { 114 114 .send_data = mhu_send_data, 115 115 .startup = mhu_startup, 116 116 .shutdown = mhu_shutdown,
+1 -1
drivers/mailbox/mailbox-altera.c
··· 285 285 } 286 286 } 287 287 288 - static struct mbox_chan_ops altera_mbox_ops = { 288 + static const struct mbox_chan_ops altera_mbox_ops = { 289 289 .send_data = altera_mbox_send_data, 290 290 .startup = altera_mbox_startup, 291 291 .shutdown = altera_mbox_shutdown,
+1 -1
drivers/mailbox/omap-mailbox.c
··· 604 604 return ret; 605 605 } 606 606 607 - static struct mbox_chan_ops omap_mbox_chan_ops = { 607 + static const struct mbox_chan_ops omap_mbox_chan_ops = { 608 608 .startup = omap_mbox_chan_startup, 609 609 .send_data = omap_mbox_chan_send_data, 610 610 .shutdown = omap_mbox_chan_shutdown,
+1 -1
drivers/mailbox/pcc.c
··· 198 198 return 0; 199 199 } 200 200 201 - static struct mbox_chan_ops pcc_chan_ops = { 201 + static const struct mbox_chan_ops pcc_chan_ops = { 202 202 .send_data = pcc_send_data, 203 203 }; 204 204
+1 -1
include/linux/mailbox_controller.h
··· 72 72 */ 73 73 struct mbox_controller { 74 74 struct device *dev; 75 - struct mbox_chan_ops *ops; 75 + const struct mbox_chan_ops *ops; 76 76 struct mbox_chan *chans; 77 77 int num_chans; 78 78 bool txdone_irq;