Re: [Patch v10 1/4] memory: tegra: Add memory controller channels support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux