Re: [PATCHi v2] net: sh_eth: Add support of device tree probe
From: Grant Likely <hidden>
Date: 2013-03-04 08:05:09
Also in:
linux-devicetree
From: Grant Likely <hidden>
Date: 2013-03-04 08:05:09
Also in:
linux-devicetree
On Thu, 14 Feb 2013 11:56:57 +0900, Nobuhiro Iwamatsu [off-list ref] wrote:
(2013/02/14 10:24), Kuninori Morimoto wrote:quoted
quoted
+#ifdef CONFIG_OF + if (np&& of_device_is_available(np)) { + pd = sh_eth_parse_dt(&pdev->dev, ndev); + if (pdev->dev.platform_data) { + struct sh_eth_plat_data *tmp = + pdev->dev.platform_data; + pd->set_mdio_gate = tmp->set_mdio_gate; + pd->needs_init = tmp->needs_init; + } + } else +#endifsh_eth_parse_dt() was defined for both CONFIG_OF and !CONFIG_OF. But it is called only from CONFIG_OF ?Because of_device_is_available needs CONFIG_OF. I already send a patch which add empty function of of_device_is_available. If this was apply, this ifdef becomes without need.
Actually, there shouldn't be any reason for a device driver to call of_device_is_available() on its own node at all. If the device is not available, then a platform_device won't be created. "if (np)" here is sufficient. g.