]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Use mdelay instead of udelay for long times.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 24 Jun 2012 19:04:21 +0000 (21:04 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 24 Jun 2012 19:04:21 +0000 (21:04 +0200)
The delays are required mostly for old, incorrectly
engineered CAN boards. So use of mdelay is deprecated
as well.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
lincan/src/aim104.c
lincan/src/m437.c
lincan/src/nsi.c
lincan/src/pc_i03.c
lincan/src/pccan.c
lincan/src/pcccan.c
lincan/src/pip.c
lincan/src/smartcan.c
lincan/src/ssv.c

index 357fe41723b114eef5b556c0ca20b789703af36e..d1db454dde26054ba4fcb26cce5cfc8ef7689fd0 100644 (file)
@@ -111,7 +111,7 @@ int aim104_reset(struct candevice_t *candev)
        i=0;
        while ( (aim104_read_register(candev->io_addr + SJACR)
                                                        & sjaCR_RR) && (i<=15) ) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i>=15) {
index 55f1d9981fabbed35190e99d9451cfebc5e45c4e..da772e893d195835b8904992e32a5e43dd841c69 100644 (file)
@@ -202,7 +202,7 @@ int m437_reset(struct candevice_t *candev)
        /* Check hardware reset status */
        i=0;
        while ( (m437_read_register(candev->dev_base_addr+iCPU) & iCPU_RST) && (i<=15)) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i>=15) {
index 3aa8c1466e22aa3ac27c4f258dd5128f505fa5bb..aac7effbd9395e005d05f771916a007c6c076021 100644 (file)
@@ -98,7 +98,7 @@ int nsi_reset(struct candevice_t *candev)
     /* Check hardware reset status */
     i=0;
     while ( (nsi_read_register(nsican_base+iCPU) & iCPU_RST) && (i<=15)) {
-       udelay(20000);
+       mdelay(20);
        i++;
     }
     if (i>=15) {
index f20b0ac0f6e30f351fe3793ad599d86a6f75d099..cd461af65103bd820554d919bc5ba304eb35edcb 100644 (file)
@@ -112,7 +112,7 @@ int pci03_reset(struct candevice_t *candev)
        DEBUGMSG("Resetting pc-i03 hardware ...\n");
        pci03_write_register(0x01,pci03_base_addr +
                                0x100); // Write arbitrary data to reset mem
-       udelay(20000);
+       mdelay(20);
 
        pci03_write_register(0x00, pci03_base_addr + SJACR);
 
@@ -120,7 +120,7 @@ int pci03_reset(struct candevice_t *candev)
        i=0;
        while ( (pci03_read_register(pci03_base_addr + SJACR) & sjaCR_RR)
                                                                 && (i<=15) ) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i>=15) {
index 7086151a7b926531709ccdd47ee9067221724d23..4e9385d6b76697e6e67085d844de79b5c43dfdce 100644 (file)
@@ -142,7 +142,7 @@ int pccanf_reset(struct candevice_t *candev)
        i=0;
        while ( (can_inb(candev->chip[0]->chip_base_addr+SJACR) & sjaCR_RR)
                                                                 && (i<=15) ) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i>=15) {
@@ -175,7 +175,7 @@ int pccand_reset(struct candevice_t *candev)
                i=0;
                while ( (can_inb(candev->chip[chip_nr]->chip_base_addr +
                                                SJACR) & sjaCR_RR) && (i<=15) ) {
-                       udelay(20000);
+                       mdelay(20);
                        i++;
                }
                if (i>=15) {
@@ -211,7 +211,7 @@ int pccanq_reset(struct candevice_t *candev)
                i=0;
                while( (can_inb(candev->chip[chip_nr]->chip_base_addr +
                                                iCPU) & iCPU_RST) && (i<=15) ) {
-                       udelay(20000);
+                       mdelay(20);
                        i++;
                }
                if (i>=15) {
@@ -226,7 +226,7 @@ int pccanq_reset(struct candevice_t *candev)
                i=0;
                while( (can_inb(candev->chip[chip_nr]->chip_base_addr +
                                                SJACR) & sjaCR_RR) && (i<=15) ) {
-                       udelay(20000);
+                       mdelay(20);
                        i++;
                }
                if (i>=15) {
index a84fca19aae45a9519c82d66ddf7faa89e23a2e9..c10893ca6d92e5a3c1754341ee53f1cea4faf888 100644 (file)
@@ -135,7 +135,7 @@ int pcccan_reset(struct candevice_t *candev)
        i=0;
        can_outb(iCPU,candev->io_addr+0x1);
        while ( (can_inb(candev->io_addr+0x2)&0x80) && (i<=15) ) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i>=15) {
index 2f1e23217b3fbfd0e869c339cebae989bbc15a01..345dd7844a8b045cce31f60c9dec9c1ad41d893e 100644 (file)
@@ -99,7 +99,7 @@ int pip_reset(struct candevice_t *candev)
        /* Check hardware reset status */
        i = 0;
        while ((can_inb(candev->io_addr + iCPU) & iCPU_RST) && (i <= 15)) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i >= 15) {
index 9c6d5e85113dffffaa2b8732694ef7807ab2f5fe..a748566717f4d192858c2151dd34818b2c26bd62 100644 (file)
@@ -78,7 +78,7 @@ int smartcan_reset(struct candevice_t *candev)
        i=0;
        can_outb(candev->io_addr+iCPU,candev->io_addr);
        while ( (can_inb(candev->io_addr+1)&0x80) && (i<=15) ) {
-               udelay(20000);
+               mdelay(20);
                i++;
        }
        if (i>=15) {
index 530859d1c0989513ff05cd338c4788f30a172d52..e08a9b612f06ad811ccca94f030d357a2aa2d4d6 100644 (file)
@@ -98,7 +98,7 @@ int ssv_reset(struct candevice_t *candev)
     /* Check hardware reset status */
     i=0;
     while ( (ssv_read_register(ssvcan_base+iCPU) & iCPU_RST) && (i<=15)) {
-       udelay(20000);
+       mdelay(20);
        i++;
     }
     if (i>=15) {
@@ -112,7 +112,7 @@ int ssv_reset(struct candevice_t *candev)
     /* Check hardware reset status */
     i=0;
     while ( (ssv_read_register(ssvcan_base+0x100+iCPU) & iCPU_RST) && (i<=15)) {
-       udelay(20000);
+       mdelay(20);
        i++;
     }
     if (i>=15) {