[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210211110519.GA1463@shell.armlinux.org.uk>
Date: Thu, 11 Feb 2021 11:05:19 +0000
From: Russell King - ARM Linux admin <linux@...linux.org.uk>
To: stefanc@...vell.com
Cc: netdev@...r.kernel.org, thomas.petazzoni@...tlin.com,
davem@...emloft.net, nadavh@...vell.com, ymarkman@...vell.com,
linux-kernel@...r.kernel.org, kuba@...nel.org, mw@...ihalf.com,
andrew@...n.ch, atenart@...nel.org, devicetree@...r.kernel.org,
robh+dt@...nel.org, sebastian.hesselbarth@...il.com,
gregory.clement@...tlin.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v13 net-next 03/15] net: mvpp2: add CM3 SRAM memory map
On Thu, Feb 11, 2021 at 12:48:50PM +0200, stefanc@...vell.com wrote:
> +static int mvpp2_get_sram(struct platform_device *pdev,
> + struct mvpp2 *priv)
> +{
> + struct resource *res;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> + if (!res) {
> + if (has_acpi_companion(&pdev->dev))
> + dev_warn(&pdev->dev, "ACPI is too old, Flow control not supported\n");
> + else
> + dev_warn(&pdev->dev, "DT is too old, Flow control not supported\n");
> + return 0;
> + }
> +
> + priv->cm3_base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->cm3_base))
> + return PTR_ERR(priv->cm3_base);
> +
> + return 0;
You can clean this up to use:
return PTR_ERR_OR_ZERO(priv->cm3_base);
> +
> + /* Map CM3 SRAM */
> + err = mvpp2_get_sram(pdev, priv);
> + if (err)
> + dev_warn(&pdev->dev, "Fail to alloc CM3 SRAM\n");
It looks to me like mvpp2_get_sram() only fails if we are unable to
_map_ the CM3 SRAM. We are no longer allocating anything from it, so
I think this message needs to be updated.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists