hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/hwmon/s3c-hwmon.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* linux/drivers/hwmon/s3c-hwmon.c
23 *
34 * Copyright (C) 2005, 2008, 2009 Simtec Electronics
....@@ -5,19 +6,6 @@
56 * Ben Dooks <ben@simtec.co.uk>
67 *
78 * S3C24XX/S3C64XX ADC hwmon support
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
219 */
2210
2311 #include <linux/module.h>
....@@ -32,7 +20,7 @@
3220 #include <linux/hwmon.h>
3321 #include <linux/hwmon-sysfs.h>
3422
35
-#include <plat/adc.h>
23
+#include <linux/soc/samsung/s3c-adc.h>
3624 #include <linux/platform_data/hwmon-s3c.h>
3725
3826 struct s3c_hwmon_attr {
....@@ -98,7 +86,7 @@
9886 static ssize_t s3c_hwmon_show_raw(struct device *dev,
9987 struct device_attribute *attr, char *buf)
10088 {
101
- struct s3c_hwmon *adc = platform_get_drvdata(to_platform_device(dev));
89
+ struct s3c_hwmon *adc = dev_get_drvdata(dev);
10290 struct sensor_device_attribute *sa = to_sensor_dev_attr(attr);
10391 int ret;
10492
....@@ -164,7 +152,7 @@
164152 char *buf)
165153 {
166154 struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr);
167
- struct s3c_hwmon *hwmon = platform_get_drvdata(to_platform_device(dev));
155
+ struct s3c_hwmon *hwmon = dev_get_drvdata(dev);
168156 struct s3c_hwmon_pdata *pdata = dev_get_platdata(dev);
169157 struct s3c_hwmon_chcfg *cfg;
170158 int ret;