| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * max31722 - hwmon driver for Maxim Integrated MAX31722/MAX31723 SPI |
|---|
| 3 | 4 | * digital thermometer and thermostats. |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Copyright (c) 2016, Intel Corporation. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This file is subject to the terms and conditions of version 2 of |
|---|
| 8 | | - * the GNU General Public License. See the file COPYING in the main |
|---|
| 9 | | - * directory of this archive for more details. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/hwmon.h> |
|---|
| .. | .. |
|---|
| 49 | 46 | return 0; |
|---|
| 50 | 47 | } |
|---|
| 51 | 48 | |
|---|
| 52 | | -static ssize_t max31722_show_temp(struct device *dev, |
|---|
| 53 | | - struct device_attribute *attr, |
|---|
| 54 | | - char *buf) |
|---|
| 49 | +static ssize_t max31722_temp_show(struct device *dev, |
|---|
| 50 | + struct device_attribute *attr, char *buf) |
|---|
| 55 | 51 | { |
|---|
| 56 | 52 | ssize_t ret; |
|---|
| 57 | 53 | struct max31722_data *data = dev_get_drvdata(dev); |
|---|
| .. | .. |
|---|
| 63 | 59 | return sprintf(buf, "%d\n", (s16)le16_to_cpu(ret) * 125 / 32); |
|---|
| 64 | 60 | } |
|---|
| 65 | 61 | |
|---|
| 66 | | -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, |
|---|
| 67 | | - max31722_show_temp, NULL, 0); |
|---|
| 62 | +static SENSOR_DEVICE_ATTR_RO(temp1_input, max31722_temp, 0); |
|---|
| 68 | 63 | |
|---|
| 69 | 64 | static struct attribute *max31722_attrs[] = { |
|---|
| 70 | 65 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
|---|