diff options
author | Igal Liberman <igal.liberman@freescale.com> | 2016-02-28 22:59:53 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-03 21:21:23 +0100 |
commit | 878e3c1be2dc8a759c18bb280a7390f9ed0bd544 (patch) | |
tree | 438336bafa7fcd6fe63aac6274e61471b5a3ec94 /drivers/net | |
parent | stmmac: Fix 'eth0: No PHY found' regression (diff) | |
download | linux-878e3c1be2dc8a759c18bb280a7390f9ed0bd544.tar.xz linux-878e3c1be2dc8a759c18bb280a7390f9ed0bd544.zip |
fsl/fman: Initialize fman->dev earlier
Currently, in a case of error, dev_err is using fman->dev
before its initialization and "(NULL device *)" is printed.
This patch fixes this issue.
Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/fman.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c index 623aa1c8ebc6..79a210aaf0bb 100644 --- a/drivers/net/ethernet/freescale/fman/fman.c +++ b/drivers/net/ethernet/freescale/fman/fman.c @@ -2791,6 +2791,8 @@ static struct fman *read_dts_node(struct platform_device *of_dev) goto fman_free; } + fman->dev = &of_dev->dev; + return fman; fman_node_put: @@ -2845,8 +2847,6 @@ static int fman_probe(struct platform_device *of_dev) dev_set_drvdata(dev, fman); - fman->dev = dev; - dev_dbg(dev, "FMan%d probed\n", fman->dts_params.id); return 0; |