common: Drop linux/bitops.h from common header
[platform/kernel/u-boot.git] / drivers / spi / ich.c
index 133b25b..7405062 100644 (file)
@@ -8,10 +8,12 @@
 #define LOG_CATEGORY   UCLASS_SPI
 
 #include <common.h>
+#include <bootstage.h>
 #include <div64.h>
 #include <dm.h>
 #include <dt-structs.h>
 #include <errno.h>
+#include <log.h>
 #include <malloc.h>
 #include <pch.h>
 #include <pci.h>
@@ -23,6 +25,8 @@
 #include <asm/fast_spi.h>
 #include <asm/io.h>
 #include <asm/mtrr.h>
+#include <linux/bitops.h>
+#include <linux/delay.h>
 #include <linux/sizes.h>
 
 #include "ich.h"
@@ -562,16 +566,8 @@ static int ich_spi_exec_op_hwseq(struct spi_slave *slave,
                return 0;  /* ignore */
        case SPINOR_OP_BE_4K:
                cycle = HSFSTS_CYCLE_4K_ERASE;
-               while (len) {
-                       uint xfer_len = 0x1000;
-
-                       ret = exec_sync_hwseq_xfer(regs, cycle, offset, 0);
-                       if (ret)
-                               return ret;
-                       offset += xfer_len;
-                       len -= xfer_len;
-               }
-               return 0;
+               ret = exec_sync_hwseq_xfer(regs, cycle, offset, 0);
+               return ret;
        default:
                debug("Unknown cycle %x\n", op->cmd.opcode);
                return -EINVAL;