]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/hwmon/lm73.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / drivers / hwmon / lm73.c
index dd246835362040cc365217d33bb5e88d84050e1c..c15c7514d86598562acaa07dd5d0ec25af189277 100644 (file)
@@ -7,23 +7,7 @@
  * (C) Copyright 2001
  * Bill Hunter,  Wave 7 Optics, williamhunter@mediaone.net
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -112,7 +96,7 @@ int dtt_write(int const sensor, int const reg, int const val)
                              dlen);
 } /* dtt_write() */
 
-static int _dtt_init(int const sensor)
+int dtt_init_one(int const sensor)
 {
        int val;
 
@@ -124,11 +108,11 @@ static int _dtt_init(int const sensor)
        /*
         * Setup THIGH (upper-limit) and TLOW (lower-limit) registers
         */
-       val = CFG_DTT_MAX_TEMP << 7;
+       val = CONFIG_SYS_DTT_MAX_TEMP << 7;
        if (dtt_write(sensor, DTT_TEMP_HIGH, val))
                return -1;
 
-       val = CFG_DTT_MIN_TEMP << 7;
+       val = CONFIG_SYS_DTT_MIN_TEMP << 7;
        if (dtt_write(sensor, DTT_TEMP_LOW, val))
                return -1;
        /*
@@ -148,23 +132,7 @@ static int _dtt_init(int const sensor)
 
        dtt_read(sensor, DTT_CONTROL);  /* clear temperature flags */
        return 0;
-} /* _dtt_init() */
-
-int dtt_init(void)
-{
-       int i;
-       unsigned char sensors[] = CONFIG_DTT_SENSORS;
-       const char *const header = "DTT:   ";
-
-       for (i = 0; i < sizeof(sensors); i++) {
-               if (0 != _dtt_init(sensors[i]))
-                       printf("%s%d FAILED INIT\n", header, i + 1);
-               else
-                       printf("%s%d is %i C\n", header, i + 1,
-                              dtt_get_temp(sensors[i]));
-       }
-       return 0;
-} /* dtt_init() */
+} /* dtt_init_one() */
 
 int dtt_get_temp(int const sensor)
 {