Skip to content

Commit bacf2fe

Browse files
cristiccvinodkoul
authored andcommitted
phy: rockchip: samsung-hdptx: Drop superfluous cfgs driver data
The ->cfgs member has been introduced via commit f08d1c0 ("phy: phy-rockchip-samsung-hdptx: Don't use dt aliases to determine phy-id"), but it is only used during probe() in order to setup ->phy_id. Use a probe() local variable to store device match data and remove the now unnecessary member from struct rk_hdptx_phy. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Cristian Ciocaltea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent bcd61d1 commit bacf2fe

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,7 @@ struct rk_hdptx_phy {
392392
struct regmap *regmap;
393393
struct regmap *grf;
394394

395-
/* PHY const config */
396-
const struct rk_hdptx_phy_cfg *cfgs;
397395
int phy_id;
398-
399396
struct phy *phy;
400397
struct clk_bulk_data *clks;
401398
int nr_clks;
@@ -1894,6 +1891,7 @@ static int rk_hdptx_phy_runtime_resume(struct device *dev)
18941891

18951892
static int rk_hdptx_phy_probe(struct platform_device *pdev)
18961893
{
1894+
const struct rk_hdptx_phy_cfg *cfgs;
18971895
struct phy_provider *phy_provider;
18981896
struct device *dev = &pdev->dev;
18991897
struct rk_hdptx_phy *hdptx;
@@ -1912,14 +1910,14 @@ static int rk_hdptx_phy_probe(struct platform_device *pdev)
19121910
return dev_err_probe(dev, PTR_ERR(regs),
19131911
"Failed to ioremap resource\n");
19141912

1915-
hdptx->cfgs = device_get_match_data(dev);
1916-
if (!hdptx->cfgs)
1913+
cfgs = device_get_match_data(dev);
1914+
if (!cfgs)
19171915
return dev_err_probe(dev, -EINVAL, "missing match data\n");
19181916

19191917
/* find the phy-id from the io address */
19201918
hdptx->phy_id = -ENODEV;
1921-
for (id = 0; id < hdptx->cfgs->num_phys; id++) {
1922-
if (res->start == hdptx->cfgs->phy_ids[id]) {
1919+
for (id = 0; id < cfgs->num_phys; id++) {
1920+
if (res->start == cfgs->phy_ids[id]) {
19231921
hdptx->phy_id = id;
19241922
break;
19251923
}

0 commit comments

Comments
 (0)