From: Bert Vermeulen <bert@biot.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Birger Koblitz <mail@birger-koblitz.de>,
linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers
Date: Fri, 1 Jan 2021 12:27:41 +0100 [thread overview]
Message-ID: <e9870e2f-d16c-3ed7-d672-7baa9a5e278c@biot.com> (raw)
In-Reply-To: <20201231142319.GA28104@wunner.de>
On 12/31/20 3:23 PM, Lukas Wunner wrote:
> On Wed, Dec 30, 2020 at 12:19:04AM +0100, Bert Vermeulen wrote:
>> +static inline void wait_ready(struct rtspi *rtspi)
>> +{
>> + while (!(readl(REG(RTL8380_SPI_SFCSR)) & RTL8380_SPI_SFCSR_RDY))
>> + ;
>> +}
>
> I'd suggest calling cpu_relax() in the loop's body.
>
>
>> + err = devm_spi_register_controller(&pdev->dev, ctrl);
>
> Since you're invoking devm_spi_register_controller() on probe,
> the controller must not be unregistered explicitly on remove.
> So the ->remove hook can be dropped altogether:
>
>> +static int realtek_spi_remove(struct platform_device *pdev)
>> +{
>> + struct spi_controller *ctrl = platform_get_drvdata(pdev);
>> +
>> + spi_unregister_controller(ctrl);
>> +
>> + return 0;
>> +}
> [...]
>> + .remove = realtek_spi_remove,
>
> The ->probe hook otherwise LGTM.
Thanks Lukas, will fix those issues.
--
Bert Vermeulen
bert@biot.com
next prev parent reply other threads:[~2021-01-01 11:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 23:19 [PATCH RESEND v2 1/2] dt-bindings: spi: Realtek RTL838x/RTL839x SPI controller Bert Vermeulen
2020-12-29 23:19 ` [PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers Bert Vermeulen
2020-12-31 14:23 ` Lukas Wunner
2021-01-01 11:27 ` Bert Vermeulen [this message]
2020-12-30 13:51 ` [PATCH RESEND v2 1/2] dt-bindings: spi: Realtek RTL838x/RTL839x SPI controller Mark Brown
2020-12-31 9:08 ` Bert Vermeulen
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=e9870e2f-d16c-3ed7-d672-7baa9a5e278c@biot.com \
--to=bert@biot.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mail@birger-koblitz.de \
--cc=robh+dt@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).