Merge branch 'fixes' into next
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 5 Mar 2018 12:04:37 +0000 (13:04 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 5 Mar 2018 12:04:37 +0000 (13:04 +0100)
1  2 
drivers/mmc/host/dw_mmc.c

@@@ -147,7 -147,19 +147,7 @@@ static int dw_mci_req_show(struct seq_f
  
        return 0;
  }
 -
 -static int dw_mci_req_open(struct inode *inode, struct file *file)
 -{
 -      return single_open(file, dw_mci_req_show, inode->i_private);
 -}
 -
 -static const struct file_operations dw_mci_req_fops = {
 -      .owner          = THIS_MODULE,
 -      .open           = dw_mci_req_open,
 -      .read           = seq_read,
 -      .llseek         = seq_lseek,
 -      .release        = single_release,
 -};
 +DEFINE_SHOW_ATTRIBUTE(dw_mci_req);
  
  static int dw_mci_regs_show(struct seq_file *s, void *v)
  {
  
        return 0;
  }
 -
 -static int dw_mci_regs_open(struct inode *inode, struct file *file)
 -{
 -      return single_open(file, dw_mci_regs_show, inode->i_private);
 -}
 -
 -static const struct file_operations dw_mci_regs_fops = {
 -      .owner          = THIS_MODULE,
 -      .open           = dw_mci_regs_open,
 -      .read           = seq_read,
 -      .llseek         = seq_lseek,
 -      .release        = single_release,
 -};
 +DEFINE_SHOW_ATTRIBUTE(dw_mci_regs);
  
  static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
  {
@@@ -389,7 -413,9 +389,9 @@@ static inline void dw_mci_set_cto(struc
        cto_div = (mci_readl(host, CLKDIV) & 0xff) * 2;
        if (cto_div == 0)
                cto_div = 1;
-       cto_ms = DIV_ROUND_UP(MSEC_PER_SEC * cto_clks * cto_div, host->bus_hz);
+       cto_ms = DIV_ROUND_UP_ULL((u64)MSEC_PER_SEC * cto_clks * cto_div,
+                                 host->bus_hz);
  
        /* add a bit spare time */
        cto_ms += 10;
@@@ -1924,8 -1950,9 +1926,9 @@@ static void dw_mci_set_drto(struct dw_m
        drto_div = (mci_readl(host, CLKDIV) & 0xff) * 2;
        if (drto_div == 0)
                drto_div = 1;
-       drto_ms = DIV_ROUND_UP(MSEC_PER_SEC * drto_clks * drto_div,
-                              host->bus_hz);
+       drto_ms = DIV_ROUND_UP_ULL((u64)MSEC_PER_SEC * drto_clks * drto_div,
+                                  host->bus_hz);
  
        /* add a bit spare time */
        drto_ms += 10;
@@@ -2001,6 -2028,7 +2004,6 @@@ static void dw_mci_tasklet_func(unsigne
                        set_bit(EVENT_CMD_COMPLETE, &host->completed_events);
                        err = dw_mci_command_complete(host, cmd);
                        if (cmd == mrq->sbc && !err) {
 -                              prev_state = state = STATE_SENDING_CMD;
                                __dw_mci_start_request(host, host->slot,
                                                       mrq->cmd);
                                goto unlock;