Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Aug 2011 16:10:16 +0000 (06:10 -1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Aug 2011 16:10:16 +0000 (06:10 -1000)
* 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x: (39 commits)
  SH: static should be at beginning of declaration
  sh: move CLKDEV_xxx_ID macro to sh_clk.h
  sh: clock-shx3: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7786: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7785: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7343: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7722: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7724: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: modify I2C clock settings
  sh: clock-sh7343: modify I2C clock settings
  sh: clock-sh7723: modify I2C clock settings
  sh: clock-sh7722: modify I2C clock settings
  sh: clock-sh7724: modify I2C clock settings
  serial: sh-sci: Fix up pretty name printing for port IRQs.
  serial: sh-sci: Kill off per-port enable/disable callbacks.
  serial: sh-sci: Add missing module description/author bits.
  serial: sh-sci: Regtype probing doesn't need to be fatal.
  sh: Tidy up pre-clkdev clk_get() error handling.
  ...

1  2 
arch/arm/mach-shmobile/clock-sh7372.c
drivers/sh/clk/core.c
drivers/tty/serial/Kconfig

@@@ -561,10 -561,6 +561,6 @@@ static struct clk mstp_clks[MSTP_NR] = 
        [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
  };
  
- #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
- #define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
- #define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
  static struct clk_lookup lookups[] = {
        /* main clocks */
        CLKDEV_CON_ID("dv_clki_div2_clk", &sh7372_dv_clki_div2_clk),
        CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
        CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
        CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
 +      CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]),
  };
  
  void __init sh7372_clock_init(void)
diff --combined drivers/sh/clk/core.c
@@@ -34,6 -34,9 +34,9 @@@ static LIST_HEAD(clock_list)
  static DEFINE_SPINLOCK(clock_lock);
  static DEFINE_MUTEX(clock_list_sem);
  
+ /* clock disable operations are not passed on to hardware during boot */
+ static int allow_disable;
  void clk_rate_table_build(struct clk *clk,
                          struct cpufreq_frequency_table *freq_table,
                          int nr_freqs,
@@@ -228,7 -231,7 +231,7 @@@ static void __clk_disable(struct clk *c
                return;
  
        if (!(--clk->usecount)) {
-               if (likely(clk->ops && clk->ops->disable))
+               if (likely(allow_disable && clk->ops && clk->ops->disable))
                        clk->ops->disable(clk);
                if (likely(clk->parent))
                        __clk_disable(clk->parent);
@@@ -393,7 -396,7 +396,7 @@@ int clk_register(struct clk *clk
  {
        int ret;
  
-       if (clk == NULL || IS_ERR(clk))
+       if (IS_ERR_OR_NULL(clk))
                return -EINVAL;
  
        /*
@@@ -670,7 -673,7 +673,7 @@@ static struct dentry *clk_debugfs_root
  static int clk_debugfs_register_one(struct clk *c)
  {
        int err;
 -      struct dentry *d, *child, *child_tmp;
 +      struct dentry *d;
        struct clk *pa = c->parent;
        char s[255];
        char *p = s;
        return 0;
  
  err_out:
 -      d = c->dentry;
 -      list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
 -              debugfs_remove(child);
 -      debugfs_remove(c->dentry);
 +      debugfs_remove_recursive(c->dentry);
        return err;
  }
  
@@@ -744,3 -750,25 +747,25 @@@ err_out
        return err;
  }
  late_initcall(clk_debugfs_init);
+ static int __init clk_late_init(void)
+ {
+       unsigned long flags;
+       struct clk *clk;
+       /* disable all clocks with zero use count */
+       mutex_lock(&clock_list_sem);
+       spin_lock_irqsave(&clock_lock, flags);
+       list_for_each_entry(clk, &clock_list, node)
+               if (!clk->usecount && clk->ops && clk->ops->disable)
+                       clk->ops->disable(clk);
+       /* from now on allow clock disable operations */
+       allow_disable = 1;
+       spin_unlock_irqrestore(&clock_lock, flags);
+       mutex_unlock(&clock_list_sem);
+       return 0;
+ }
+ late_initcall(clk_late_init);
@@@ -457,6 -457,7 +457,6 @@@ config SERIAL_SAMSUNG_UARTS_
  config SERIAL_SAMSUNG_UARTS
        int
        depends on ARM && PLAT_SAMSUNG
 -      default 2 if ARCH_S3C2400
        default 6 if ARCH_S5P6450
        default 4 if SERIAL_SAMSUNG_UARTS_4
        default 3
@@@ -488,6 -489,13 +488,6 @@@ config SERIAL_SAMSUNG_CONSOL
          your boot loader about how to pass options to the kernel at
          boot time.)
  
 -config SERIAL_S3C2400
 -      tristate "Samsung S3C2410 Serial port support"
 -      depends on ARM && SERIAL_SAMSUNG && CPU_S3C2400
 -      default y if CPU_S3C2400
 -      help
 -        Serial port support for the Samsung S3C2400 SoC
 -
  config SERIAL_S3C2410
        tristate "Samsung S3C2410 Serial port support"
        depends on SERIAL_SAMSUNG && CPU_S3C2410
@@@ -511,6 -519,13 +511,6 @@@ config SERIAL_S3C244
        help
          Serial port support for the Samsung S3C2440, S3C2416 and S3C2442 SoC
  
 -config SERIAL_S3C24A0
 -      tristate "Samsung S3C24A0 Serial port support"
 -      depends on SERIAL_SAMSUNG && CPU_S3C24A0
 -      default y if CPU_S3C24A0
 -      help
 -        Serial port support for the Samsung S3C24A0 SoC
 -
  config SERIAL_S3C6400
        tristate "Samsung S3C6400/S3C6410/S5P6440/S5P6450/S5PC100 Serial port support"
        depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5P6450 || CPU_S5PC100)
@@@ -959,7 -974,7 +959,7 @@@ config SERIAL_IP22_ZILOG_CONSOL
  
  config SERIAL_SH_SCI
        tristate "SuperH SCI(F) serial port support"
-       depends on HAVE_CLK && (SUPERH || H8300 || ARCH_SHMOBILE)
+       depends on HAVE_CLK && (SUPERH || ARCH_SHMOBILE)
        select SERIAL_CORE
  
  config SERIAL_SH_SCI_NR_UARTS
@@@ -1404,7 -1419,7 +1404,7 @@@ config SERIAL_SC26X
  
  config SERIAL_SC26XX_CONSOLE
        bool "Console on SC2681/SC2692 serial port"
 -      depends on SERIAL_SC26XX
 +      depends on SERIAL_SC26XX=y
        select SERIAL_CORE_CONSOLE
        help
          Support for Console on SC2681/SC2692 serial ports.