]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/hwmon/lm63.c
ddr: altera: sequencer: Zap bogus redefinition of RW_MGR_MEM_NUMBER_OF_RANKS
[karo-tx-uboot.git] / drivers / hwmon / lm63.c
index 2f1f3cfabf2086ecba00275582a7351eb16d2b4d..053c785fc56268b443631ef81002a405d93de782 100644 (file)
@@ -3,23 +3,7 @@
  * Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de
  * based on lm75.c by Bill Hunter
  *
- * 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+
  */
 
 /*
@@ -101,7 +85,7 @@ static int is_lm64(int sensor)
        return sensor && (sensor != DTT_I2C_LM63_ADDR);
 }
 
-static int _dtt_init(int sensor)
+int dtt_init_one(int sensor)
 {
        int i;
        int val;
@@ -133,8 +117,7 @@ static int _dtt_init(int sensor)
        /*
         * Setup PWM Lookup-Table
         */
-       for (i = 0; i < sizeof(pwm_lookup) / sizeof(struct pwm_lookup_entry);
-            i++) {
+       for (i = 0; i < ARRAY_SIZE(pwm_lookup); i++) {
                int address = DTT_PWM_LOOKUP_BASE + 2 * i;
                val = pwm_lookup[i].temp;
                if (is_lm64(sensor))
@@ -175,20 +158,3 @@ int dtt_get_temp(int sensor)
        /* Ignore LSB for now, U-Boot only prints natural numbers */
        return temp >> 8;
 }
-
-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 (_dtt_init(sensors[i]) != 0)
-                       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;
-}