mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
stmmac: dwmac-socfpga: move socfpga_dwmac_probe function
Move socfpga_dwmac_probe in preparation for turning it into a proper probe function. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5ed1c04a38
commit
82732789e8
1 changed files with 25 additions and 25 deletions
|
@ -175,31 +175,6 @@ static int socfpga_dwmac_setup(struct socfpga_dwmac *dwmac)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void *socfpga_dwmac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
int ret;
|
||||
struct socfpga_dwmac *dwmac;
|
||||
|
||||
dwmac = devm_kzalloc(dev, sizeof(*dwmac), GFP_KERNEL);
|
||||
if (!dwmac)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
ret = socfpga_dwmac_parse_data(dwmac, dev);
|
||||
if (ret) {
|
||||
dev_err(dev, "Unable to parse OF data\n");
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
ret = socfpga_dwmac_setup(dwmac);
|
||||
if (ret) {
|
||||
dev_err(dev, "couldn't setup SoC glue (%d)\n", ret);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return dwmac;
|
||||
}
|
||||
|
||||
static void socfpga_dwmac_exit(struct platform_device *pdev, void *priv)
|
||||
{
|
||||
struct socfpga_dwmac *dwmac = priv;
|
||||
|
@ -257,6 +232,31 @@ static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void *socfpga_dwmac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
int ret;
|
||||
struct socfpga_dwmac *dwmac;
|
||||
|
||||
dwmac = devm_kzalloc(dev, sizeof(*dwmac), GFP_KERNEL);
|
||||
if (!dwmac)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
ret = socfpga_dwmac_parse_data(dwmac, dev);
|
||||
if (ret) {
|
||||
dev_err(dev, "Unable to parse OF data\n");
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
ret = socfpga_dwmac_setup(dwmac);
|
||||
if (ret) {
|
||||
dev_err(dev, "couldn't setup SoC glue (%d)\n", ret);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return dwmac;
|
||||
}
|
||||
|
||||
static const struct stmmac_of_data socfpga_gmac_data = {
|
||||
.setup = socfpga_dwmac_probe,
|
||||
.init = socfpga_dwmac_init,
|
||||
|
|
Loading…
Reference in a new issue