[PATCH 2/6] miidev: actually probe the PHY

Roberto Nibali rnibali at gmail.com
Mon Jun 18 14:27:08 EDT 2012


Hi

On Mon, Jun 18, 2012 at 4:47 PM, Johannes Stezenbach <js at sig21.net> wrote:

> Check if the PHY is really accessible (e.g. the
> PHY address is correct) during probe.
>
> Signed-off-by: Johannes Stezenbach <js at sig21.net>
> ---
>  drivers/net/miidev.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/miidev.c b/drivers/net/miidev.c
> index 272234e..3545889 100644
> --- a/drivers/net/miidev.c
> +++ b/drivers/net/miidev.c
> @@ -225,6 +225,14 @@ static struct file_operations miidev_ops = {
>  static int miidev_probe(struct device_d *dev)
>  {
>        struct mii_device *mdev = dev->priv;
> +       int val;
> +
> +       val = mii_read(mdev, mdev->address, MII_PHYSID1);
> +       if (val < 0 || val == 0xffff)
> +               goto err_out;
> +       val = mii_read(mdev, mdev->address, MII_PHYSID2);
> +       if (val < 0 || val == 0xffff)
> +               goto err_out;
>
>
Suppose this has no influence on drivers/net/fec_imx.c:fec_set_hwaddr()
returning -1?

Otherwise I believe this is fine.

Cheers
Roberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20120618/2f4485da/attachment.html>


More information about the barebox mailing list