Thread (1 message) 1 message, 1 author, 2015-02-03

[PATCH v5 2/7] mailbox: arm_mhu: add driver for ARM MHU controller

From: Jassi Brar <hidden>
Date: 2015-02-03 14:39:34
Also in: linux-devicetree

On 3 February 2015 at 18:02, Russell King - ARM Linux
[off-list ref] wrote:
On Tue, Feb 03, 2015 at 05:29:23PM +0800, Vincent Yang wrote:
quoted
+static int mhu_send_data(struct mbox_chan *chan, void *data)
+{
+     struct mhu_link *mlink = chan->con_priv;
+
+     pr_debug("%s:%d\n", __func__, __LINE__);
+     if (!mhu_last_tx_done(chan)) {
+             dev_err(chan->mbox->dev, "Last TX(%d) pending!\n", mlink->irq);
+             return -EBUSY;
+     }
+
+     writel_relaxed((u32)data, mlink->tx_reg + INTR_SET_OFS);
Doesn't that cause a GCC warning?
I don't see any, but I'll drop the cast.
quoted
+static int mhu_probe(struct amba_device *adev, const struct amba_id *id)
+{
+     int i, err;
+     struct arm_mhu *mhu;
+     struct device *dev = &adev->dev;
+     int mhu_reg[3] = {0x0, 0x20, 0x200};
+
+     err = amba_request_regions(adev, NULL);
+     if (err)
+             return err;
+
+     /* Allocate memory for device */
+     mhu = devm_kzalloc(dev, sizeof(*mhu), GFP_KERNEL);
+     if (!mhu)
+             return -ENOMEM;
+
+     mhu->base = devm_ioremap(dev, adev->res.start,
+                              resource_size(&adev->res));
+     if (!mhu->base) {
+             dev_err(dev, "ioremap failed\n");
+             return -ENXIO;
        mhu->base = devm_ioremap_resource(dev, &adev->res);
        if (IS_ERR(mhu->base)) {
                dev_err(dev, "ioremap failed\n");
                return PTR_ERR(mhu->base);
OK
quoted
+
+     err = mbox_controller_register(&mhu->mbox);
+     if (err) {
+             dev_err(dev, "Failed to register mailboxes %d\n", err);
+             return err;
+     }
+
+     dev_err(dev, "ARM MHU Mailbox registered\n");
Why is this an error?
ouch! this sneaked in from debugging code. Will make it info.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help