Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[sfrench/cifs-2.6.git] / drivers / net / chelsio / my3126.c
index 0b90014d5b3e7a4d19f032c679b57c72a3b98f59..87dde3e600468a465bfb6bc7c5b73ae01c45d85a 100644 (file)
@@ -10,25 +10,25 @@ static int my3126_reset(struct cphy *cphy, int wait)
         * This can be done through registers.  It is not required since
         * a full chip reset is used.
         */
-       return (0);
+       return 0;
 }
 
 static int my3126_interrupt_enable(struct cphy *cphy)
 {
        schedule_delayed_work(&cphy->phy_update, HZ/30);
        t1_tpi_read(cphy->adapter, A_ELMER0_GPO, &cphy->elmer_gpo);
-       return (0);
+       return 0;
 }
 
 static int my3126_interrupt_disable(struct cphy *cphy)
 {
        cancel_rearming_delayed_work(&cphy->phy_update);
-       return (0);
+       return 0;
 }
 
 static int my3126_interrupt_clear(struct cphy *cphy)
 {
-       return (0);
+       return 0;
 }
 
 #define OFFSET(REG_ADDR)    (REG_ADDR << 2)
@@ -93,14 +93,16 @@ static int my3126_interrupt_handler(struct cphy *cphy)
        return cphy_cause_link_change;
 }
 
-static void my3216_poll(void *arg)
+static void my3216_poll(struct work_struct *work)
 {
-       my3126_interrupt_handler(arg);
+       struct cphy *cphy = container_of(work, struct cphy, phy_update.work);
+
+       my3126_interrupt_handler(cphy);
 }
 
 static int my3126_set_loopback(struct cphy *cphy, int on)
 {
-       return (0);
+       return 0;
 }
 
 /* To check the activity LED */
@@ -144,7 +146,7 @@ static int my3126_get_link_status(struct cphy *cphy,
        if (fc)
                *fc = PAUSE_RX | PAUSE_TX;
 
-       return (0);
+       return 0;
 }
 
 static void my3126_destroy(struct cphy *cphy)
@@ -168,13 +170,14 @@ static struct cphy *my3126_phy_create(adapter_t *adapter,
 {
        struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);
 
-       if (cphy)
-               cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
+       if (!cphy)
+               return NULL;
 
-       INIT_WORK(&cphy->phy_update, my3216_poll, cphy);
+       cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
+       INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
        cphy->bmsr = 0;
 
-       return (cphy);
+       return cphy;
 }
 
 /* Chip Reset */
@@ -195,7 +198,7 @@ static int my3126_phy_reset(adapter_t * adapter)
        val |= 0x8000;
        t1_tpi_write(adapter, A_ELMER0_GPO, val);
        udelay(100);
-       return (0);
+       return 0;
 }
 
 struct gphy t1_my3126_ops = {