lkml.org 
[lkml]   [2022]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC net-next 3/3] net: phy: mscc-miim: add support to set MDIO bus frequency
> @@ -295,21 +323,41 @@ static int mscc_miim_probe(struct platform_device *pdev)
> if (!miim->info)
> return -EINVAL;
>
> - ret = of_mdiobus_register(bus, pdev->dev.of_node);
> + miim->clk = devm_clk_get_optional(&pdev->dev, NULL);
> + if (IS_ERR(miim->clk))
> + return PTR_ERR(miim->clk);
> +
> + ret = clk_prepare_enable(miim->clk);
> + if (ret)
> + return ret;
> +
> + of_property_read_u32(np, "clock-frequency", &miim->clk_freq);

The clock is optional if there is no "clock-frequency" property. If
the property does exist, the clock should be mandatory. I don't think
it should silently fail setting the bus frequency because the clock is
missing.

Andrew

\
 
 \ /
  Last update: 2022-03-31 18:28    [W:0.296 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site