linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Bert Vermeulen <bert@biot.com>
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: Thu, 31 Dec 2020 15:23:19 +0100	[thread overview]
Message-ID: <20201231142319.GA28104@wunner.de> (raw)
In-Reply-To: <20201229231904.2558916-2-bert@biot.com>

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

  reply	other threads:[~2020-12-31 14:24 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 [this message]
2021-01-01 11:27     ` Bert Vermeulen
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=20201231142319.GA28104@wunner.de \
    --to=lukas@wunner.de \
    --cc=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=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).