ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] mailbox: sun6i: modernize probe and convert to fully managed
Date: Mon, 27 Jul 2026 19:48:42 +0000	[thread overview]
Message-ID: <20260727194843.63A921F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727194208.10082-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The function `devm_mbox_controller_register()` is called with one argument, but it requires two, causing a build failure.
--

--- Patch [1]: [PATCH] mailbox: sun6i: modernize probe and convert to fully managed ---
commit 6febca9f53cbed2f1affb7635d88de86beffdca8
Author: Rosen Penev <rosenp@gmail.com>

mailbox: sun6i: modernize probe and convert to fully managed

This patch replaces manual resource cleanup with devres-managed variants in
the sun6i mailbox driver. It converts IRQ, MMIO, clock, and mailbox
controller registration to use their devm_* equivalents and removes the
manual error paths and remove callback.

> diff --git a/drivers/mailbox/sun6i-msgbox.c b/drivers/mailbox/sun6i-msgbox.c
> index 6ba6920f4645e..28d8636afad26 100644
> --- a/drivers/mailbox/sun6i-msgbox.c
> +++ b/drivers/mailbox/sun6i-msgbox.c
[ ... ]
> @@ -271,29 +267,8 @@ static int sun6i_msgbox_probe(struct platform_device *pdev)
>  	mbox->controller.txpoll_period = 5;
>  
>  	spin_lock_init(&mbox->lock);
> -	platform_set_drvdata(pdev, mbox);
> -
> -	ret = mbox_controller_register(&mbox->controller);
> -	if (ret) {
> -		dev_err(dev, "Failed to register controller: %d\n", ret);
> -		goto err_disable_unprepare;
> -	}
> -
> -	return 0;
> -
> -err_disable_unprepare:
> -	clk_disable_unprepare(mbox->clk);
> -
> -	return ret;
> -}
> -
> -static void sun6i_msgbox_remove(struct platform_device *pdev)
> -{
> -	struct sun6i_msgbox *mbox = platform_get_drvdata(pdev);
>  
> -	mbox_controller_unregister(&mbox->controller);
> -	/* See the comment in sun6i_msgbox_probe about the reset line. */
> -	clk_disable_unprepare(mbox->clk);
> +	return devm_mbox_controller_register(&mbox->controller);

[Severity: Low]
Will this compile successfully?

Looking at the function signature in drivers/mailbox/mailbox.c,
devm_mbox_controller_register() requires two arguments:

int devm_mbox_controller_register(struct device *dev,
                                  struct mbox_controller *mbox)

The call here only provides the mbox_controller pointer and is missing the
struct device pointer as the first argument, which is likely to result in
a build failure.

>  }
>  
>  static const struct of_device_id sun6i_msgbox_of_match[] = {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260727194208.10082-1-rosenp@gmail.com?part=1

  reply	other threads:[~2026-07-27 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 19:42 [PATCH] mailbox: sun6i: modernize probe and convert to fully managed Rosen Penev
2026-07-27 19:48 ` sashiko-bot [this message]
2026-07-28 15:56 ` Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260727194843.63A921F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=rosenp@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox