Commit f07cb4b4 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Paolo Abeni
Browse files

net: stmmac: ipq806x: remove of_get_phy_mode()



devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Pass plat_dat into ipq806x_gmac_of_parse(), and set gmac->phy_mode from
plat_dat->phy_interface.

Reviewed-by: default avatarMichal Kubiak <michal.kubiak@intel.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tsIGX-005uzl-TQ@rmk-PC.armlinux.org.uk


Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent e3ef1217
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -211,16 +211,12 @@ static int ipq806x_gmac_set_speed(struct ipq806x_gmac *gmac, int speed)
	return 0;
}

static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac,
				 struct plat_stmmacenet_data *plat_dat)
{
	struct device *dev = &gmac->pdev->dev;
	int ret;

	ret = of_get_phy_mode(dev->of_node, &gmac->phy_mode);
	if (ret) {
		dev_err(dev, "missing phy mode property\n");
		return -EINVAL;
	}
	gmac->phy_mode = plat_dat->phy_interface;

	if (of_property_read_u32(dev->of_node, "qcom,id", &gmac->id) < 0) {
		dev_err(dev, "missing qcom id property\n");
@@ -398,7 +394,7 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)

	gmac->pdev = pdev;

	err = ipq806x_gmac_of_parse(gmac);
	err = ipq806x_gmac_of_parse(gmac, plat_dat);
	if (err) {
		dev_err(dev, "device tree parsing error\n");
		return err;