]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/hwmon/tmp102.c
Merge branch 'cve-2019-3016' into kvm-next-5.6
[linux.git] / drivers / hwmon / tmp102.c
index 35523d315f256b157401a06c804806754522d43a..5fe35e5b2f739b895c6e5776ff7444afa9971c61 100644 (file)
@@ -1,16 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Texas Instruments TMP102 SMBus temperature sensor driver
  *
  * Copyright (C) 2010 Steven King <sfking@fdwdc.com>
- *
- * 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.
  */
 
 #include <linux/delay.h>
@@ -150,29 +141,11 @@ static umode_t tmp102_is_visible(const void *data, enum hwmon_sensor_types type,
        }
 }
 
-static u32 tmp102_chip_config[] = {
-       HWMON_C_REGISTER_TZ,
-       0
-};
-
-static const struct hwmon_channel_info tmp102_chip = {
-       .type = hwmon_chip,
-       .config = tmp102_chip_config,
-};
-
-static u32 tmp102_temp_config[] = {
-       HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST,
-       0
-};
-
-static const struct hwmon_channel_info tmp102_temp = {
-       .type = hwmon_temp,
-       .config = tmp102_temp_config,
-};
-
 static const struct hwmon_channel_info *tmp102_info[] = {
-       &tmp102_chip,
-       &tmp102_temp,
+       HWMON_CHANNEL_INFO(chip,
+                          HWMON_C_REGISTER_TZ),
+       HWMON_CHANNEL_INFO(temp,
+                          HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
        NULL
 };
 
@@ -321,7 +294,7 @@ static const struct i2c_device_id tmp102_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, tmp102_id);
 
-static const struct of_device_id tmp102_of_match[] = {
+static const struct of_device_id __maybe_unused tmp102_of_match[] = {
        { .compatible = "ti,tmp102" },
        { },
 };