[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YaBl66b7VFJK84F4@google.com>
Date: Fri, 26 Nov 2021 12:43:23 +0800
From: Tzung-Bi Shih <tzungbi@...gle.com>
To: "allen-kh.cheng" <allen-kh.cheng@...iatek.com>
Cc: Jassi Brar <jassisinghbrar@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Linux-ALSA <alsa-devel@...a-project.org>,
cujomalainey@...gle.com,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Liam Girdwood <lgirdwood@...il.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Daniel Baluta <daniel.baluta@....com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Project_Global_Chrome_Upstream_Group@...iatek.com,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
sound-open-firmware@...a-project.org
Subject: Re: [PATCH v4 3/3] mailbox: mediatek: add support for adsp mailbox
controller
On Thu, Nov 25, 2021 at 08:29:25PM +0800, allen-kh.cheng wrote:
> diff --git a/drivers/mailbox/mtk-adsp-mailbox.c b/drivers/mailbox/mtk-adsp-mailbox.c
[...]
> +static bool mtk_adsp_mbox_last_tx_done(struct mbox_chan *chan)
> +{
> + struct adsp_mbox_ch_info *ch_info = chan->con_priv;
> + void __iomem *reg = ch_info->va_reg;
> +
> + return (readl(reg + MTK_ADSP_MBOX_IN_CMD) == 0) ? true : false;
To be concise, readl(reg + MTK_ADSP_MBOX_IN_CMD) == 0.
> +static int mtk_adsp_mbox_probe(struct platform_device *pdev)
> +{
[...]
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res) {
> + dev_err(dev, "no adsp mbox register resource\n");
> + return -ENXIO;
> + }
> +
> + priv->va_mboxreg = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(priv->va_mboxreg))
> + return PTR_ERR(priv->va_mboxreg);
If using devm_platform_ioremap_resource(), it doesn't need to call platform_get_resource(). res is unused.
Powered by blists - more mailing lists