[PATCH v5 2/2] mailbox: mediatek: Add mtk-vcp-mailbox driver
Jjian Zhou (周建)
Jjian.Zhou at mediatek.com
Mon Sep 22 20:08:17 PDT 2025
On Thu, 2025-09-18 at 18:50 -0500, Jassi Brar wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On Thu, Aug 21, 2025 at 9:12 PM Jjian Zhou <jjian.zhou at mediatek.com>
> wrote:
>
> .....
>
> > +#include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/slab.h>
> > +
> > +struct mtk_vcp_mbox_priv {
>
> Maybe 'mtk_vcp_mbox' is a more appropriate name ?
>
> > + void __iomem *base;
> > + struct device *dev;
> > + struct mbox_controller mbox;
> > + const struct mtk_vcp_mbox_cfg *cfg;
> > + struct mtk_ipi_info ipi_recv;
>
> Maybe also have "struct mbox_chan chan[1]; " so that you don't have
> to
> allocate one during the probe.
> Also if you have "struct mbox_controller mbox;" as the first member,
> you could simply typecast that to get this structure.
> Something like "struct mpfs_mbox" in mailbox-mpfs.c
>
The define "struct mbox_chan chan[1]" has style error.
ERROR:FLEXIBLE_ARRAY: Use C99 flexible arrays - see
https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
#81: FILE: drivers/mailbox/mtk-vcp-mailbox.c:24:
+ struct mbox_chan chans[0];
+};
How about this error?
> ....
> > +
> > +static struct mbox_chan *mtk_vcp_mbox_xlate(struct mbox_controller
> > *mbox,
> > + const struct
> > of_phandle_args *sp)
> > +{
> > + if (sp->args_count)
> > + return NULL;
> > +
> > + return mbox->chans;
>
> return &mbox->chans[0] seems better.
>
> thnx
More information about the Linux-mediatek
mailing list