[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2e0df511-f9fa-2905-f381-fc1158774ab4@collabora.com>
Date: Fri, 29 Apr 2022 17:56:50 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: Ashish Mhetre <amhetre@...dia.com>, krzysztof.kozlowski@...aro.org,
thierry.reding@...il.com, jonathanh@...dia.com, digetx@...il.com,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
devicetree@...r.kernel.org
Cc: vdumpa@...dia.com, Snikam@...dia.com
Subject: Re: [Patch v10 1/4] memory: tegra: Add memory controller channels
support
On 4/29/22 14:34, Ashish Mhetre wrote:
> static int tegra186_mc_probe(struct tegra_mc *mc)
> {
> + struct platform_device *pdev = to_platform_device(mc->dev);
> + unsigned int i;
> int err;
>
> + mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "broadcast");
> + if (IS_ERR(mc->bcast_ch_regs)) {
> + if (PTR_ERR(mc->bcast_ch_regs) == -EINVAL) {
> + dev_warn(&pdev->dev, "Broadcast channel is missing, please update your device-tree\n");
> + mc->bcast_ch_regs = NULL;
> + goto skip_map_regs;
> + }
> + return PTR_ERR(mc->bcast_ch_regs);
> + }
> +
> + mc->ch_regs = devm_kcalloc(mc->dev, mc->soc->num_channels,
> + sizeof(*mc->ch_regs), GFP_KERNEL);
> + if (!mc->ch_regs)
> + return -ENOMEM;
> +
> + for (i = 0; i < mc->soc->num_channels; i++) {
> + char name[5];
> +
> + snprintf(name, sizeof(name), "ch%u", i);
> + mc->ch_regs[i] = devm_platform_ioremap_resource_byname(pdev, name);
> + if (IS_ERR(mc->ch_regs[i]))
> + return PTR_ERR(mc->ch_regs[i]);
> + }
> +
> +skip_map_regs:
> err = of_platform_populate(mc->dev->of_node, NULL, NULL, mc->dev);
More common to name labels by the action pointed by label, like
"populate:" in this case. No need to make v11 because of that.
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@...labora.com>
Powered by blists - more mailing lists