Re: [PATCHv3 net-next] net: dsa: b53: srab: propagate errors from init helpers

Paolo Abeni <[email protected]> Tue, 4 Aug 2026 13:00:26 +0200
Newsgroups gmane.linux.network,gmane.linux.kernel
Message-ID <[email protected]>
On 7/29/26 10:29 PM, Rosen Penev wrote:
> -static void b53_srab_mux_init(struct platform_device *pdev)
> +static int b53_srab_mux_init(struct platform_device *pdev)
>  {
>  	struct b53_device *dev = platform_get_drvdata(pdev);
>  	struct b53_srab_priv *priv = dev->priv;
>  	struct b53_srab_port_priv *p;
> +	void __iomem *mux_config;
>  	unsigned int port;
>  	u32 reg, off = 0;
>  	int ret;
>  
> -	if (dev->pdata && dev->pdata->chip_id != BCM58XX_DEVICE_ID)
> -		return;
> +	if (!dev->pdata || dev->pdata->chip_id != BCM58XX_DEVICE_ID)
> +		return 0;
>  
> -	priv->mux_config = devm_platform_ioremap_resource(pdev, 1);
> -	if (IS_ERR(priv->mux_config))
> -		return;
> +	mux_config = devm_platform_ioremap_resource(pdev, 1);
> +	if (IS_ERR(mux_config))
> +		return PTR_ERR(mux_config);

Sashiko noted this strict checking may cause regression on previously
working setup:

https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260729202953.704662-1-rosenp%40gmail.com

/P