mirror of https://gitee.com/openkylin/linux.git
fs_enet: Whitespace cleanup.
Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
3de96471bd
commit
0fb300fa9d
|
@ -343,7 +343,6 @@ static void fs_enet_tx(struct net_device *dev)
|
||||||
|
|
||||||
do_wake = do_restart = 0;
|
do_wake = do_restart = 0;
|
||||||
while (((sc = CBDR_SC(bdp)) & BD_ENET_TX_READY) == 0) {
|
while (((sc = CBDR_SC(bdp)) & BD_ENET_TX_READY) == 0) {
|
||||||
|
|
||||||
dirtyidx = bdp - fep->tx_bd_base;
|
dirtyidx = bdp - fep->tx_bd_base;
|
||||||
|
|
||||||
if (fep->tx_free == fep->tx_ring)
|
if (fep->tx_free == fep->tx_ring)
|
||||||
|
@ -444,7 +443,6 @@ fs_enet_interrupt(int irq, void *dev_id)
|
||||||
|
|
||||||
nr = 0;
|
nr = 0;
|
||||||
while ((int_events = (*fep->ops->get_int_events)(dev)) != 0) {
|
while ((int_events = (*fep->ops->get_int_events)(dev)) != 0) {
|
||||||
|
|
||||||
nr++;
|
nr++;
|
||||||
|
|
||||||
int_clr_events = int_events;
|
int_clr_events = int_events;
|
||||||
|
@ -700,45 +698,43 @@ static void fs_timeout(struct net_device *dev)
|
||||||
*-----------------------------------------------------------------------------*/
|
*-----------------------------------------------------------------------------*/
|
||||||
static void generic_adjust_link(struct net_device *dev)
|
static void generic_adjust_link(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct fs_enet_private *fep = netdev_priv(dev);
|
struct fs_enet_private *fep = netdev_priv(dev);
|
||||||
struct phy_device *phydev = fep->phydev;
|
struct phy_device *phydev = fep->phydev;
|
||||||
int new_state = 0;
|
int new_state = 0;
|
||||||
|
|
||||||
if (phydev->link) {
|
if (phydev->link) {
|
||||||
|
/* adjust to duplex mode */
|
||||||
|
if (phydev->duplex != fep->oldduplex) {
|
||||||
|
new_state = 1;
|
||||||
|
fep->oldduplex = phydev->duplex;
|
||||||
|
}
|
||||||
|
|
||||||
/* adjust to duplex mode */
|
if (phydev->speed != fep->oldspeed) {
|
||||||
if (phydev->duplex != fep->oldduplex){
|
new_state = 1;
|
||||||
new_state = 1;
|
fep->oldspeed = phydev->speed;
|
||||||
fep->oldduplex = phydev->duplex;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (phydev->speed != fep->oldspeed) {
|
if (!fep->oldlink) {
|
||||||
new_state = 1;
|
new_state = 1;
|
||||||
fep->oldspeed = phydev->speed;
|
fep->oldlink = 1;
|
||||||
}
|
netif_schedule(dev);
|
||||||
|
netif_carrier_on(dev);
|
||||||
|
netif_start_queue(dev);
|
||||||
|
}
|
||||||
|
|
||||||
if (!fep->oldlink) {
|
if (new_state)
|
||||||
new_state = 1;
|
fep->ops->restart(dev);
|
||||||
fep->oldlink = 1;
|
} else if (fep->oldlink) {
|
||||||
netif_schedule(dev);
|
new_state = 1;
|
||||||
netif_carrier_on(dev);
|
fep->oldlink = 0;
|
||||||
netif_start_queue(dev);
|
fep->oldspeed = 0;
|
||||||
}
|
fep->oldduplex = -1;
|
||||||
|
netif_carrier_off(dev);
|
||||||
|
netif_stop_queue(dev);
|
||||||
|
}
|
||||||
|
|
||||||
if (new_state)
|
if (new_state && netif_msg_link(fep))
|
||||||
fep->ops->restart(dev);
|
phy_print_status(phydev);
|
||||||
|
|
||||||
} else if (fep->oldlink) {
|
|
||||||
new_state = 1;
|
|
||||||
fep->oldlink = 0;
|
|
||||||
fep->oldspeed = 0;
|
|
||||||
fep->oldduplex = -1;
|
|
||||||
netif_carrier_off(dev);
|
|
||||||
netif_stop_queue(dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (new_state && netif_msg_link(fep))
|
|
||||||
phy_print_status(phydev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -782,7 +778,6 @@ static int fs_init_phy(struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int fs_enet_open(struct net_device *dev)
|
static int fs_enet_open(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct fs_enet_private *fep = netdev_priv(dev);
|
struct fs_enet_private *fep = netdev_priv(dev);
|
||||||
|
@ -971,7 +966,7 @@ static struct net_device *fs_init_instance(struct device *dev,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FS_ENET_HAS_SCC
|
#ifdef CONFIG_FS_ENET_HAS_SCC
|
||||||
if (fs_get_scc_index(fpi->fs_no) >=0 )
|
if (fs_get_scc_index(fpi->fs_no) >=0)
|
||||||
fep->ops = &fs_scc_ops;
|
fep->ops = &fs_scc_ops;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1066,9 +1061,8 @@ static struct net_device *fs_init_instance(struct device *dev,
|
||||||
|
|
||||||
return ndev;
|
return ndev;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
if (ndev != NULL) {
|
if (ndev != NULL) {
|
||||||
|
|
||||||
if (registered)
|
if (registered)
|
||||||
unregister_netdev(ndev);
|
unregister_netdev(ndev);
|
||||||
|
|
||||||
|
@ -1259,7 +1253,6 @@ static int __init fs_init(void)
|
||||||
err:
|
err:
|
||||||
cleanup_immap();
|
cleanup_immap();
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit fs_cleanup(void)
|
static void __exit fs_cleanup(void)
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
#include <asm/commproc.h>
|
#include <asm/commproc.h>
|
||||||
|
|
||||||
struct fec_info {
|
struct fec_info {
|
||||||
fec_t* fecp;
|
fec_t *fecp;
|
||||||
u32 mii_speed;
|
u32 mii_speed;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,6 @@
|
||||||
static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 mcn, u32 op)
|
static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 mcn, u32 op)
|
||||||
{
|
{
|
||||||
const struct fs_platform_info *fpi = fep->fpi;
|
const struct fs_platform_info *fpi = fep->fpi;
|
||||||
|
|
||||||
cpm2_map_t *immap = fs_enet_immap;
|
cpm2_map_t *immap = fs_enet_immap;
|
||||||
cpm_cpm2_t *cpmp = &immap->im_cpm;
|
cpm_cpm2_t *cpmp = &immap->im_cpm;
|
||||||
u32 v;
|
u32 v;
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
* kind, whether express or implied.
|
* kind, whether express or implied.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
@ -308,7 +307,6 @@ static int fs_mii_bitbang_init(struct bb_info *bitbang, struct fs_mii_bb_platfor
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int __devinit fs_enet_mdio_probe(struct device *dev)
|
static int __devinit fs_enet_mdio_probe(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
@ -371,7 +369,6 @@ static int __devinit fs_enet_mdio_probe(struct device *dev)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int fs_enet_mdio_remove(struct device *dev)
|
static int fs_enet_mdio_remove(struct device *dev)
|
||||||
{
|
{
|
||||||
struct mii_bus *bus = dev_get_drvdata(dev);
|
struct mii_bus *bus = dev_get_drvdata(dev);
|
||||||
|
|
|
@ -113,7 +113,6 @@ static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int location)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location, u16 val)
|
static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location, u16 val)
|
||||||
|
|
Loading…
Reference in New Issue