From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] phy: add phy_drivers_register
Date: Thu, 15 Nov 2012 10:31:43 +0100 [thread overview]
Message-ID: <1352971904-12409-1-git-send-email-plagnioj@jcrosoft.com> (raw)
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
next reply other threads:[~2012-11-15 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 9:31 Jean-Christophe PLAGNIOL-VILLARD [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352971904-12409-1-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox