| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * An hwmon driver for the Microchip TC74 |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Copyright 2006 Stefan Roese, DENX Software Engineering |
|---|
| 8 | 9 | * Copyright 2008 Sean MacLennan, PIKA Technologies |
|---|
| 9 | 10 | * Copyright 2008 Frank Edelhaeuser, Spansion Inc. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 12 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 13 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 14 | | - * (at your option) any later version. |
|---|
| 15 | 11 | */ |
|---|
| 16 | 12 | |
|---|
| 17 | 13 | #include <linux/bitops.h> |
|---|
| .. | .. |
|---|
| 86 | 82 | return ret; |
|---|
| 87 | 83 | } |
|---|
| 88 | 84 | |
|---|
| 89 | | -static ssize_t show_temp_input(struct device *dev, |
|---|
| 85 | +static ssize_t temp_input_show(struct device *dev, |
|---|
| 90 | 86 | struct device_attribute *attr, char *buf) |
|---|
| 91 | 87 | { |
|---|
| 92 | 88 | struct tc74_data *data = dev_get_drvdata(dev); |
|---|
| .. | .. |
|---|
| 98 | 94 | |
|---|
| 99 | 95 | return sprintf(buf, "%d\n", data->temp_input * 1000); |
|---|
| 100 | 96 | } |
|---|
| 101 | | -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL, 0); |
|---|
| 97 | +static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0); |
|---|
| 102 | 98 | |
|---|
| 103 | 99 | static struct attribute *tc74_attrs[] = { |
|---|
| 104 | 100 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
|---|
| .. | .. |
|---|
| 107 | 103 | |
|---|
| 108 | 104 | ATTRIBUTE_GROUPS(tc74); |
|---|
| 109 | 105 | |
|---|
| 110 | | -static int tc74_probe(struct i2c_client *client, |
|---|
| 111 | | - const struct i2c_device_id *dev_id) |
|---|
| 106 | +static int tc74_probe(struct i2c_client *client) |
|---|
| 112 | 107 | { |
|---|
| 113 | 108 | struct device *dev = &client->dev; |
|---|
| 114 | 109 | struct tc74_data *data; |
|---|
| .. | .. |
|---|
| 165 | 160 | .driver = { |
|---|
| 166 | 161 | .name = "tc74", |
|---|
| 167 | 162 | }, |
|---|
| 168 | | - .probe = tc74_probe, |
|---|
| 163 | + .probe_new = tc74_probe, |
|---|
| 169 | 164 | .id_table = tc74_id, |
|---|
| 170 | 165 | }; |
|---|
| 171 | 166 | |
|---|