Skip to content

Commit

Permalink
net: sun4i_wemac: remove PHY_POWER conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
amery committed Nov 7, 2012
1 parent ad4e389 commit 6a7a8bd
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/net/sun4i/sun4i_wemac.c
Expand Up @@ -53,7 +53,6 @@
#define DRV_VERSION "1.01"
#define DMA_CPU_TRRESHOLD 2000
#define TOLOWER(x) ((x) | 0x20)
#define PHY_POWER 0
/*
* Transmit timeout, default 5 seconds.
*/
Expand Down Expand Up @@ -133,10 +132,8 @@ typedef struct wemac_board_info {

struct mii_if_info mii;
u32 msg_enable;
#if PHY_POWER
user_gpio_set_t *mos_gpio;
u32 mos_pin_handler;
#endif
} wemac_board_info_t;

/* debug code */
Expand Down Expand Up @@ -1078,12 +1075,11 @@ wemac_init_wemac(struct net_device *dev)
unsigned int phy_reg;
unsigned int reg_val;

#if PHY_POWER
if (db->mos_pin_handler) {
db->mos_gpio->data = 1;
gpio_set_one_pin_status(db->mos_pin_handler, db->mos_gpio, "emac_power", 1);
}
#endif

/* PHY POWER UP */
phy_reg = wemac_phy_read(dev, 0, 0);
wemac_phy_write(dev, 0, 0, phy_reg & (~(1<<11)));
Expand Down Expand Up @@ -1623,12 +1619,10 @@ static void wemac_shutdown(struct net_device *dev)
reg_val);
wemac_phy_write(dev, 0, 0, reg_val | (1<<11)); /* PHY POWER DOWN */

#if PHY_POWER
if (db->mos_pin_handler) {
db->mos_gpio->data = 0;
gpio_set_one_pin_status(db->mos_pin_handler, db->mos_gpio, "emac_power", 1);
}
#endif

writel(0, db->emac_vbase + EMAC_INT_CTL_REG); /* Disable all interrupt */
writel(readl(db->emac_vbase + EMAC_INT_STA_REG), db->emac_vbase + EMAC_INT_STA_REG); /* clear interupt status */
Expand Down Expand Up @@ -1793,7 +1787,6 @@ static int __devinit wemac_probe(struct platform_device *pdev)
goto out;
}

#if PHY_POWER
db->mos_gpio = kmalloc(sizeof(user_gpio_set_t), GFP_KERNEL);
db->mos_pin_handler = 0;
if (NULL == db->mos_gpio) {
Expand All @@ -1809,7 +1802,7 @@ static int __devinit wemac_probe(struct platform_device *pdev)
db->mos_gpio->port, db->mos_gpio->port_num);
}
}
#endif

/* ccmu address remap */
iosize = res_size(db->ccmu_base_res);
db->ccmu_base_req = request_mem_region(db->ccmu_base_res->start, iosize,
Expand Down

0 comments on commit 6a7a8bd

Please sign in to comment.