| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * AD7314 digital temperature sensor driver for AD7314, ADT7301 and ADT7302 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2010 Analog Devices Inc. |
|---|
| 5 | | - * |
|---|
| 6 | | - * Licensed under the GPL-2 or later. |
|---|
| 7 | 6 | * |
|---|
| 8 | 7 | * Conversion to hwmon from IIO done by Jonathan Cameron <jic23@cam.ac.uk> |
|---|
| 9 | 8 | */ |
|---|
| .. | .. |
|---|
| 53 | 52 | return be16_to_cpu(chip->rx); |
|---|
| 54 | 53 | } |
|---|
| 55 | 54 | |
|---|
| 56 | | -static ssize_t ad7314_show_temperature(struct device *dev, |
|---|
| 57 | | - struct device_attribute *attr, |
|---|
| 58 | | - char *buf) |
|---|
| 55 | +static ssize_t ad7314_temperature_show(struct device *dev, |
|---|
| 56 | + struct device_attribute *attr, |
|---|
| 57 | + char *buf) |
|---|
| 59 | 58 | { |
|---|
| 60 | 59 | struct ad7314_data *chip = dev_get_drvdata(dev); |
|---|
| 61 | 60 | s16 data; |
|---|
| .. | .. |
|---|
| 87 | 86 | } |
|---|
| 88 | 87 | } |
|---|
| 89 | 88 | |
|---|
| 90 | | -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, |
|---|
| 91 | | - ad7314_show_temperature, NULL, 0); |
|---|
| 89 | +static SENSOR_DEVICE_ATTR_RO(temp1_input, ad7314_temperature, 0); |
|---|
| 92 | 90 | |
|---|
| 93 | 91 | static struct attribute *ad7314_attrs[] = { |
|---|
| 94 | 92 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
|---|