mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] phy: add phy_drivers_register
@ 2012-11-15  9:31 Jean-Christophe PLAGNIOL-VILLARD
  2012-11-15  9:31 ` [PATCH 2/2] phy: add smsc phy driver support Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-15  9:31 UTC (permalink / raw)
  To: barebox

to allow to register an array of drivers

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/net/phy/phy.c |   12 ++++++++++++
 include/linux/phy.h   |    1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index daa657f..5a4be54 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -705,6 +705,18 @@ int phy_driver_register(struct phy_driver *phydrv)
 	return register_driver(&phydrv->drv);
 }
 
+int phy_drivers_register(struct phy_driver *new_driver, int n)
+{
+	int i, ret = 0;
+
+	for (i = 0; i < n; i++) {
+		ret = phy_driver_register(new_driver + i);
+		if (ret)
+			return ret;
+	}
+	return ret;
+}
+
 int phy_init_hw(struct phy_device *phydev)
 {
 	struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index fa21984..ce6f22c 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -235,6 +235,7 @@ struct phy_fixup {
 };
 
 int phy_driver_register(struct phy_driver *drv);
+int phy_drivers_register(struct phy_driver *new_driver, int n);
 struct phy_device *get_phy_device(struct mii_bus *bus, int addr);
 int phy_init(void);
 int phy_init_hw(struct phy_device *phydev);
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-08 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15  9:31 [PATCH 1/2] phy: add phy_drivers_register Jean-Christophe PLAGNIOL-VILLARD
2012-11-15  9:31 ` [PATCH 2/2] phy: add smsc phy driver support Jean-Christophe PLAGNIOL-VILLARD
2012-11-15 11:29   ` Sascha Hauer
2012-11-15 11:58   ` [PATCH 1/1 v2] " Jean-Christophe PLAGNIOL-VILLARD
2012-12-08 15:05   ` [PATCH 2/2] " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox