Diff for /qemu/hw/omap_clk.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2018/04/24 16:53:26 version 1.1.1.2, 2018/04/24 17:24:33
Line 16 Line 16
  * GNU General Public License for more details.   * GNU General Public License for more details.
  *   *
  * You should have received a copy of the GNU General Public License along   * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,   * with this program; if not, see <http://www.gnu.org/licenses/>.
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  
  */   */
 #include "hw.h"  #include "hw.h"
 #include "omap.h"  #include "omap.h"
Line 1098  void omap_clk_adduser(struct clk *clk, q Line 1097  void omap_clk_adduser(struct clk *clk, q
     *i = user;      *i = user;
 }  }
   
 /* If a clock is allowed to idle, it is disabled automatically when  
  * all of clock domains using it are disabled.  */  
 static int omap_clk_is_idle(struct clk *clk)  
 {  
     struct clk *chld;  
   
     if (!clk->enabled && (!clk->usecount || !(clk->flags && ALWAYS_ENABLED)))  
         return 1;  
     if (clk->usecount)  
         return 0;  
   
     for (chld = clk->child1; chld; chld = chld->sibling)  
         if (!omap_clk_is_idle(chld))  
             return 0;  
     return 1;  
 }  
   
 struct clk *omap_findclk(struct omap_mpu_state_s *mpu, const char *name)  struct clk *omap_findclk(struct omap_mpu_state_s *mpu, const char *name)
 {  {
     struct clk *i;      struct clk *i;
Line 1122  struct clk *omap_findclk(struct omap_mpu Line 1104  struct clk *omap_findclk(struct omap_mpu
     for (i = mpu->clks; i->name; i ++)      for (i = mpu->clks; i->name; i ++)
         if (!strcmp(i->name, name) || (i->alias && !strcmp(i->alias, name)))          if (!strcmp(i->name, name) || (i->alias && !strcmp(i->alias, name)))
             return i;              return i;
     cpu_abort(mpu->env, "%s: %s not found\n", __FUNCTION__, name);      hw_error("%s: %s not found\n", __FUNCTION__, name);
 }  }
   
 void omap_clk_get(struct clk *clk)  void omap_clk_get(struct clk *clk)
Line 1133  void omap_clk_get(struct clk *clk) Line 1115  void omap_clk_get(struct clk *clk)
 void omap_clk_put(struct clk *clk)  void omap_clk_put(struct clk *clk)
 {  {
     if (!(clk->usecount --))      if (!(clk->usecount --))
         cpu_abort(cpu_single_env, "%s: %s is not in use\n",          hw_error("%s: %s is not in use\n", __FUNCTION__, clk->name);
                         __FUNCTION__, clk->name);  
 }  }
   
 static void omap_clk_update(struct clk *clk)  static void omap_clk_update(struct clk *clk)

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


unix.superglobalmegacorp.com