diff mbox series

eth: Fix crash while enabling fixed-phy

Message ID CAEnBdDpNAbPNnAO3v2SgpzcRHY7MEbLSW+-e8Bh0OBF3qHGgGA@mail.gmail.com
State New
Delegated to: Marek Vasut
Headers show
Series eth: Fix crash while enabling fixed-phy | expand

Commit Message

Mikle Lappo Feb. 10, 2020, 6:31 p.m. UTC
From db35a238c5ae530e82d6de4cab180d570a3d8fc9 Mon Sep 17 00:00:00 2001
From: Mikhail Lappo <miklelappo@gmail.com>
Date: Fri, 7 Feb 2020 14:13:25 +0100
Subject: [PATCH] eth: Fix crash while enabling fixed-phy

Fixed phy is always enabled and doesn't
implement writeext function

Signed-off-by: Mikhail Lappo <miklelappo@gmail.com>
CC: Marek Vasut <marek.vasut+renesas@gmail.com>
---
 drivers/net/ravb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index fb4a628d63..46e02ed14c 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -434,7 +434,8 @@  static int ravb_config(struct udevice *dev)

  writel(mask, eth->iobase + RAVB_REG_ECMR);

- phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19);
+ if (phy->drv->writeext)
+ phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19);

  return 0;
 }