[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230613173937.fhk2cqcankg6oej6@ripper>
Date: Tue, 13 Jun 2023 10:39:37 -0700
From: Bjorn Andersson <andersson@...nel.org>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Vinod Koul <vkoul@...nel.org>,
Bhupesh Sharma <bhupesh.sharma@...aro.org>,
Andy Gross <agross@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>, netdev@...r.kernel.org,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-phy@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 03/26] phy: qcom: add the SGMII SerDes PHY driver
On Mon, Jun 12, 2023 at 11:23:32AM +0200, Bartosz Golaszewski wrote:
> diff --git a/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c
[..]
> +static int qcom_dwmac_sgmii_phy_probe(struct platform_device *pdev)
> +{
> + struct qcom_dwmac_sgmii_phy_data *data;
> + struct device *dev = &pdev->dev;
> + struct phy_provider *provider;
> + struct clk *refclk;
> + void __iomem *base;
> + struct phy *phy;
> +
> + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(base))
> + return PTR_ERR(base);
> +
> + data->regmap = devm_regmap_init_mmio(dev, base,
> + &qcom_dwmac_sgmii_phy_regmap_cfg);
> + if (IS_ERR(data->regmap))
> + return PTR_ERR(data->regmap);
> +
> + phy = devm_phy_create(dev, NULL, &qcom_dwmac_sgmii_phy_ops);
> + if (IS_ERR(phy))
> + return PTR_ERR(phy);
> +
> + refclk = devm_clk_get_enabled(dev, "sgmi_ref");
> + if (IS_ERR(refclk))
> + return PTR_ERR(refclk);
> +
> + provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> + if (IS_ERR(provider))
> + return PTR_ERR(provider);
> +
> + phy_set_drvdata(phy, data);
> + platform_set_drvdata(pdev, data);
You don't use the pdev's dev's drvdata, so I think you can drop the
platform_set_drvdata()
Regards,
Bjorn
> +
> + return 0;
> +}
Powered by blists - more mailing lists