Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/sunxi Clocks and resets are not present on all ...



details:   https://anonhg.NetBSD.org/src/rev/731547b3d4fd
branches:  trunk
changeset: 447171:731547b3d4fd
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jan 02 19:32:41 2019 +0000

description:
Clocks and resets are not present on all SoCs

diffstat:

 sys/arch/arm/sunxi/sunxi_thermal.c |  40 +++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diffs (65 lines):

diff -r 51969fa3811e -r 731547b3d4fd sys/arch/arm/sunxi/sunxi_thermal.c
--- a/sys/arch/arm/sunxi/sunxi_thermal.c        Wed Jan 02 19:32:18 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_thermal.c        Wed Jan 02 19:32:41 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_thermal.c,v 1.6 2018/08/21 14:09:41 bsiegert Exp $ */
+/* $NetBSD: sunxi_thermal.c,v 1.7 2019/01/02 19:32:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.6 2018/08/21 14:09:41 bsiegert Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.7 2019/01/02 19:32:41 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -513,28 +513,28 @@
        int error;
 
        clk = fdtbus_clock_get(sc->phandle, "ahb");
-       if (clk == NULL)
-               return ENXIO;
-       error = clk_enable(clk);
-       if (error != 0)
-               return error;
+       if (clk) {
+               error = clk_enable(clk);
+               if (error != 0)
+                       return error;
+       }
 
        clk = fdtbus_clock_get(sc->phandle, "ths");
-       if (clk == NULL)
-               return ENXIO;
-       error = clk_set_rate(clk, sc->conf->clk_rate);
-       if (error != 0)
-               return error;
-       error = clk_enable(clk);
-       if (error != 0)
-               return error;
+       if (clk) {
+               error = clk_set_rate(clk, sc->conf->clk_rate);
+               if (error != 0)
+                       return error;
+               error = clk_enable(clk);
+               if (error != 0)
+                       return error;
+       }
 
        rst = fdtbus_reset_get_index(sc->phandle, 0);
-       if (rst == NULL)
-               return ENXIO;
-       error = fdtbus_reset_deassert(rst);
-       if (error != 0)
-               return error;
+       if (rst) {
+               error = fdtbus_reset_deassert(rst);
+               if (error != 0)
+                       return error;
+       }
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index