void (*work)(struct work_struct *))
{
struct omap_mbox_queue *mq;
+ unsigned int size;
if (!work)
return NULL;
spin_lock_init(&mq->lock);
- if (kfifo_alloc(&mq->fifo, mbox_kfifo_size, GFP_KERNEL))
+ /* kfifo size sanity check: alignment and minimal size */
+ size = ALIGN(mbox_kfifo_size, sizeof(u32));
+ size = max_t(unsigned int, size, sizeof(u32));
+ if (kfifo_alloc(&mq->fifo, size, GFP_KERNEL))
goto error;
INIT_WORK(&mq->work, work);
if (err)
return err;
- /* kfifo size sanity check: alignment and minimal size */
- mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(u32));
- mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(u32));
-
err = platform_driver_register(&omap_mbox_driver);
if (err)
class_unregister(&omap_mbox_class);