[PATCH v6 2/5] net: atheros: Add a check for OF_CONTROL
Simon Glass
sjg at chromium.org
Sun Jul 25 18:13:44 CEST 2021
This phy cannot be used when OF_CONTROL is not enabled. A few boards
expect it to build, though, so add a runtime check for this case.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v6:
- Add new patch for atheros
drivers/net/phy/atheros.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index f922fecd6b5..cc772f3060f 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -7,6 +7,7 @@
* Copyright (c) 2019 Michael Walle <michael at walle.cc>
*/
#include <common.h>
+#include <log.h>
#include <phy.h>
#include <dm/device_compat.h>
#include <linux/bitfield.h>
@@ -197,6 +198,16 @@ static int ar803x_of_init(struct phy_device *phydev)
u32 strength, freq, min_uV, max_uV;
int sel;
+ /*
+ * This driver requires OF_CONTROL but this is included on some boards
+ * that don't support it in SPL. Return an error so the board vendor
+ * can resolve this.
+ */
+ if (!CONFIG_IS_ENABLED(OF_CONTROL)) {
+ log_err("atheros driver requires OF_CONTROL enabled");
+ return -ENOSYS;
+ }
+
node = phy_get_ofnode(phydev);
if (!ofnode_valid(node))
return -EINVAL;
--
2.32.0.432.gabb21c7263-goog
More information about the U-Boot
mailing list