Commit cc84d89a authored by Vitalii Mordan's avatar Vitalii Mordan Committed by Jakub Kicinski
Browse files

stmmac: dwmac-intel-plat: remove redundant dwmac->data check in probe



The driver’s compatibility with devices is confirmed earlier in
platform_match(). Since reaching probe means the device is valid,
the extra check can be removed to simplify the code.

Signed-off-by: default avatarVitalii Mordan <mordan@ispras.ru>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e867ed3a
Loading
Loading
Loading
Loading
+28 −25
Original line number Diff line number Diff line
@@ -97,8 +97,12 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
	dwmac->dev = &pdev->dev;
	dwmac->tx_clk = NULL;

	/*
	 * This cannot return NULL at this point because the driver’s
	 * compatibility with the device has already been validated in
	 * platform_match().
	 */
	dwmac->data = device_get_match_data(&pdev->dev);
	if (dwmac->data) {
	if (dwmac->data->fix_mac_speed)
		plat_dat->fix_mac_speed = dwmac->data->fix_mac_speed;

@@ -127,7 +131,6 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
				goto err_tx_clk_disable;
			}
		}
		}

		/* Check and configure PTP ref clock rate */
		rate = clk_get_rate(plat_dat->clk_ptp_ref);