forked from luck/tmp_suning_uos_patched
net: Fix sungem_phy sharing.
Since sungem_phy is used by multiple, unrelated, drivers make it build as a real module under drivers/net. depmod will pick up the symbol dependency and make sure sungem_phy.ko gets loaded any time sungem.ko or spider_net.ko is loaded. Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ef37d38a1f
commit
19e2f6fe96
@ -186,6 +186,9 @@ config MII
|
||||
|
||||
source "drivers/net/phy/Kconfig"
|
||||
|
||||
config SUNGEM_PHY
|
||||
tristate
|
||||
|
||||
#
|
||||
# Ethernet
|
||||
#
|
||||
|
@ -75,3 +75,5 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
|
||||
|
||||
obj-$(CONFIG_WIMAX) += wimax/
|
||||
obj-$(CONFIG_CAIF) += caif/
|
||||
|
||||
obj-$(CONFIG_SUNGEM_PHY) += sungem_phy.o
|
||||
|
@ -6,7 +6,6 @@ obj-$(CONFIG_HAPPYMEAL) += sunhme.o
|
||||
obj-$(CONFIG_SUNQE) += sunqe.o
|
||||
obj-$(CONFIG_SUNBMAC) += sunbmac.o
|
||||
obj-$(CONFIG_SUNGEM) += sungem.o
|
||||
obj-$(CONFIG_SUNGEM_PHY) += sungem_phy.o
|
||||
obj-$(CONFIG_CASSINI) += cassini.o
|
||||
obj-$(CONFIG_SUNVNET) += sunvnet.o
|
||||
obj-$(CONFIG_NIU) += niu.o
|
||||
|
@ -1721,7 +1721,7 @@ static void gem_init_phy(struct gem *gp)
|
||||
if (gp->phy_type == phy_mii_mdio0 ||
|
||||
gp->phy_type == phy_mii_mdio1) {
|
||||
/* Reset and detect MII PHY */
|
||||
mii_phy_probe(&gp->phy_mii, gp->mii_phy_addr);
|
||||
sungem_phy_probe(&gp->phy_mii, gp->mii_phy_addr);
|
||||
|
||||
/* Init PHY */
|
||||
if (gp->phy_mii.def && gp->phy_mii.def->ops->init)
|
||||
|
@ -6,5 +6,5 @@ obj-$(CONFIG_GELIC_NET) += ps3_gelic.o
|
||||
gelic_wireless-$(CONFIG_GELIC_WIRELESS) += ps3_gelic_wireless.o
|
||||
ps3_gelic-objs += ps3_gelic_net.o $(gelic_wireless-y)
|
||||
spidernet-y += spider_net.o spider_net_ethtool.o
|
||||
obj-$(CONFIG_SPIDER_NET) += spidernet.o ethernet/sun/sungem_phy.o
|
||||
obj-$(CONFIG_SPIDER_NET) += spidernet.o
|
||||
obj-$(CONFIG_TC35815) += tc35815.o
|
||||
|
@ -196,7 +196,7 @@ spider_net_setup_aneg(struct spider_net_card *card)
|
||||
if ((bmsr & BMSR_ESTATEN) && (estat & ESTATUS_1000_THALF))
|
||||
advertise |= SUPPORTED_1000baseT_Half;
|
||||
|
||||
mii_phy_probe(phy, phy->mii_id);
|
||||
sungem_phy_probe(phy, phy->mii_id);
|
||||
phy->def->ops->setup_aneg(phy, advertise);
|
||||
|
||||
}
|
||||
@ -2120,7 +2120,7 @@ spider_net_setup_phy(struct spider_net_card *card)
|
||||
unsigned short id;
|
||||
id = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMSR);
|
||||
if (id != 0x0000 && id != 0xffff) {
|
||||
if (!mii_phy_probe(phy, phy->mii_id)) {
|
||||
if (!sungem_phy_probe(phy, phy->mii_id)) {
|
||||
pr_info("Found %s.\n", phy->def->name);
|
||||
break;
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ static struct mii_phy_def* mii_phy_table[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
int mii_phy_probe(struct mii_phy *phy, int mii_id)
|
||||
int sungem_phy_probe(struct mii_phy *phy, int mii_id)
|
||||
{
|
||||
int rc;
|
||||
u32 id;
|
||||
@ -1195,6 +1195,5 @@ int mii_phy_probe(struct mii_phy *phy, int mii_id)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(mii_phy_probe);
|
||||
EXPORT_SYMBOL(sungem_phy_probe);
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -61,7 +61,7 @@ struct mii_phy
|
||||
/* Pass in a struct mii_phy with dev, mdio_read and mdio_write
|
||||
* filled, the remaining fields will be filled on return
|
||||
*/
|
||||
extern int mii_phy_probe(struct mii_phy *phy, int mii_id);
|
||||
extern int sungem_phy_probe(struct mii_phy *phy, int mii_id);
|
||||
|
||||
|
||||
/* MII definitions missing from mii.h */
|
||||
|
Loading…
Reference in New Issue
Block a user