lkml.org 
[lkml]   [2020]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] Add support for Cadence XSPI controller
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

\
 
 \ /
  Last update: 2020-12-12 13:20    [W:0.045 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site