[PATCHv2 net-next] net: use pdev instead of OF funcs

Jakub Kicinski kuba at kernel.org
Mon Nov 11 19:32:22 PST 2024


On Mon, 11 Nov 2024 13:03:16 -0800 Rosen Penev wrote:
> --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
> +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
> @@ -111,7 +111,7 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
>  	}
>  
>  	/* Get the SXGBE common INT information */
> -	priv->irq  = irq_of_parse_and_map(node, 0);
> +	priv->irq = platform_get_irq(pdev, 0);
>  	if (priv->irq <= 0) {
>  		dev_err(dev, "sxgbe common irq parsing failed\n");
>  		goto err_drv_remove;
> @@ -122,7 +122,7 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
>  
>  	/* Get the TX/RX IRQ numbers */
>  	for (i = 0, chan = 1; i < SXGBE_TX_QUEUES; i++) {
> -		priv->txq[i]->irq_no = irq_of_parse_and_map(node, chan++);
> +		priv->txq[i]->irq_no = platform_get_irq(pdev, chan++);
>  		if (priv->txq[i]->irq_no <= 0) {
>  			dev_err(dev, "sxgbe tx irq parsing failed\n");
>  			goto err_tx_irq_unmap;
> @@ -130,14 +130,14 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
>  	}
>  
>  	for (i = 0; i < SXGBE_RX_QUEUES; i++) {
> -		priv->rxq[i]->irq_no = irq_of_parse_and_map(node, chan++);
> +		priv->rxq[i]->irq_no = platform_get_irq(pdev, chan++);
>  		if (priv->rxq[i]->irq_no <= 0) {
>  			dev_err(dev, "sxgbe rx irq parsing failed\n");
>  			goto err_rx_irq_unmap;
>  		}
>  	}
>  
> -	priv->lpi_irq = irq_of_parse_and_map(node, chan);
> +	priv->lpi_irq = platform_get_irq(pdev, chan);
>  	if (priv->lpi_irq <= 0) {
>  		dev_err(dev, "sxgbe lpi irq parsing failed\n");
>  		goto err_rx_irq_unmap;

Coccicheck wants you to drop the errors:

drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:116:2-9: line 116 is redundant because platform_get_irq() already prints an error
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:127:3-10: line 127 is redundant because platform_get_irq() already prints an error
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:135:3-10: line 135 is redundant because platform_get_irq() already prints an error
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:142:2-9: line 142 is redundant because platform_get_irq() already prints an error

You can make it a separate patch in a series, for clarity.
-- 
pw-bot: cr



More information about the linux-arm-kernel mailing list