Remove an unused and invalid struct mbox_chan pointer from the private
data and fix incorrect memory handling in the probe path, where the
private data structure was allocated.

This change corrects a functional bugs and cleans up the driver without
altering its behavior.

Fixes: 111e9bf6a5ac ("mailbox: add PolarFire SoC mailbox driver")
Signed-off-by: Jamie Gibbons <[email protected]>
---
 drivers/mailbox/mpfs-mbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mailbox/mpfs-mbox.c b/drivers/mailbox/mpfs-mbox.c
index 2e20b08307c..08c51c96718 100644
--- a/drivers/mailbox/mpfs-mbox.c
+++ b/drivers/mailbox/mpfs-mbox.c
@@ -37,13 +37,12 @@ struct mpfs_mbox {
        struct udevice *dev;
        void __iomem *ctrl_base;
        void __iomem *mbox_base;
-       struct mbox_chan *chan;
 };
 
 static bool mpfs_mbox_busy(struct mbox_chan *chan)
 {
        struct mpfs_mbox *mbox = dev_get_priv(chan->dev);
-       uint16_t status;
+       u32 status;
 
        status = readl(mbox->ctrl_base + SERVICES_SR_OFFSET);
 
@@ -152,7 +151,6 @@ static int mpfs_mbox_probe(struct udevice *dev)
        mbox->mbox_base = devm_ioremap(dev, res.start, resource_size(&res));
 
        mbox->dev = dev;
-       mbox->chan->con_priv = mbox;
 
        return 0;
 }
-- 
2.43.0

Reply via email to