#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/mutex.h>
#include <linux/of_mdio.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#define MVMDIO_SMI_POLL_INTERVAL_MAX 55
struct orion_mdio_dev {
- struct mutex lock;
void __iomem *regs;
struct clk *clk[3];
/*
u32 val;
int ret;
- mutex_lock(&dev->lock);
-
ret = orion_mdio_wait_ready(bus);
if (ret < 0)
goto out;
ret = val & GENMASK(15, 0);
out:
- mutex_unlock(&dev->lock);
return ret;
}
struct orion_mdio_dev *dev = bus->priv;
int ret;
- mutex_lock(&dev->lock);
-
ret = orion_mdio_wait_ready(bus);
if (ret < 0)
goto out;
dev->regs);
out:
- mutex_unlock(&dev->lock);
return ret;
}
return -EPROBE_DEFER;
}
- mutex_init(&dev->lock);
-
if (pdev->dev.of_node)
ret = of_mdiobus_register(bus, pdev->dev.of_node);
else