net: davinci_emac: fix oops caused by uninitialized ndev->dev
Commit e1943128 (drivers: net: davinci_cpdma: Convert kzalloc() to devm_kzalloc()) triggered a bug in emac_probe() wherein dev member of net_device is used for devres allocations even before it is initialized. This patch fixes that by using the struct device in platform_device instead. While at it, use &pdev->dev consistently for console messages instead of using ndev->dev for just one case and remove an unnecessary line continuation. Reported-by: NKevin Hilman <khilman@linaro.org> Helped-by: NGeorge Cherian <george.cherian@ti.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com> Acked-by: NMugunthan V N <mugunthanvnm@ti.com> Tested-by: NLad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: NKevin Hilman <khilman@linaro.org> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Showing
想要评论请 注册 或 登录