linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Jayshri Pawar <jpawar@cadence.com>
Cc: linux-spi@vger.kernel.org, miquel.raynal@bootlin.com,
	richard@nod.at, vigneshr@ti.com, linux-kernel@vger.kernel.org,
	dkangude@cadence.com, mparab@cadence.com, sjakhade@cadence.com,
	Konrad Kociolek <konrad@cadence.com>
Subject: Re: [PATCH 1/2] Add support for Cadence XSPI controller
Date: Sat, 12 Dec 2020 13:18:53 +0100	[thread overview]
Message-ID: <20201212121853.GA5065@wunner.de> (raw)
In-Reply-To: <1607500678-23862-2-git-send-email-jpawar@cadence.com>

On Wed, Dec 09, 2020 at 08:57:57AM +0100, Jayshri Pawar wrote:
> +	master = spi_alloc_master(dev, sizeof(*cdns_xspi));
> +	if (!master) {
> +		ret = -ENOMEM;
> +		dev_err(dev, "Failed to allocate memory for spi_master\n");
> +		goto err_no_mem;
> +	}

Please use devm_spi_alloc_master() to simplify the probe error path.
It was introduced in v5.10-rc5 with commit 5e844cc37a5c and is also
available in 5.9-stable and 5.4-stable.

The memory allocater already emits an error message if it can't satisfy
a request.  Emitting an additional message here isn't really necessary.


> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	cdns_xspi->iobase = devm_ioremap_resource(cdns_xspi->dev, res);
> +	if (IS_ERR(cdns_xspi->iobase)) {
> +		ret = PTR_ERR(cdns_xspi->iobase);
> +		dev_err(dev, "Failed to remap controller base address\n");
> +		goto err_spi_master;
> +	}

Please use devm_platform_ioremap_resource().

Thanks,

Lukas

  parent reply	other threads:[~2020-12-12 12:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  7:57 [PATCH 0/2] Driver for Cadence xSPI flash controller Jayshri Pawar
2020-12-09  7:57 ` [PATCH 1/2] Add support for Cadence XSPI controller Jayshri Pawar
2020-12-09 10:28   ` kernel test robot
2020-12-10 10:33   ` kernel test robot
2020-12-12 12:18   ` Lukas Wunner [this message]
2020-12-09  7:57 ` [PATCH 2/2] Add dt-bindings documentation " Jayshri Pawar

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=20201212121853.GA5065@wunner.de \
    --to=lukas@wunner.de \
    --cc=dkangude@cadence.com \
    --cc=jpawar@cadence.com \
    --cc=konrad@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mparab@cadence.com \
    --cc=richard@nod.at \
    --cc=sjakhade@cadence.com \
    --cc=vigneshr@ti.com \
    /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).