Netdev List
 help / color / mirror / Atom feed
* Platform init code in stmmac_main
@ 2016-12-27 11:47 Joao Pinto
  0 siblings, 0 replies; only message in thread
From: Joao Pinto @ 2016-12-27 11:47 UTC (permalink / raw)
  To: pavel@ucw.cz, Niklas Cassel, Giuseppe CAVALLARO, Florian Fainelli,
	netdev

Hello,

I spotted in stmmac_main.c, *_dvr_probe() function, some clocks initializations
that are related with platform based setups:


	priv->pclk = devm_clk_get(priv->device, "pclk");
	if (IS_ERR(priv->pclk)) {
		if (PTR_ERR(priv->pclk) == -EPROBE_DEFER) {
			ret = -EPROBE_DEFER;
			goto error_pclk_get;
		}
		priv->pclk = NULL;
	}
	clk_prepare_enable(priv->pclk);

	priv->stmmac_rst = devm_reset_control_get(priv->device,
						  STMMAC_RESOURCE_NAME);
	if (IS_ERR(priv->stmmac_rst)) {
		if (PTR_ERR(priv->stmmac_rst) == -EPROBE_DEFER) {
			ret = -EPROBE_DEFER;
			goto error_hw_init;
		}
		dev_info(priv->device, "no reset control found\n");
		priv->stmmac_rst = NULL;
	}
	if (priv->stmmac_rst)
		reset_control_deassert(priv->stmmac_rst);

I am using PCI based setup, so these initializations are executed since they are
in common space in stmmac_main.c. Wouldn't be better to map these clocks in
stmmac_platform? This hasn't any problem for me, but I think it would improve
code readbility.

I would like to have your opinion about the subject!

Thanks,
Joao

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-27 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-27 11:47 Platform init code in stmmac_main Joao Pinto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox