.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * asb100.c - Part of lm_sensors, Linux kernel modules for hardware |
---|
3 | 4 | * monitoring |
---|
.. | .. |
---|
9 | 10 | * Copyright (C) 1998 - 2003 Frodo Looijaard <frodol@dds.nl>, |
---|
10 | 11 | * Philip Edelbrock <phil@netroedge.com>, and |
---|
11 | 12 | * Mark Studebaker <mdsxyz123@yahoo.com> |
---|
12 | | - * |
---|
13 | | - * This program is free software; you can redistribute it and/or modify |
---|
14 | | - * it under the terms of the GNU General Public License as published by |
---|
15 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
16 | | - * (at your option) any later version. |
---|
17 | | - * |
---|
18 | | - * This program is distributed in the hope that it will be useful, |
---|
19 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | | - * GNU General Public License for more details. |
---|
22 | | - * |
---|
23 | | - * You should have received a copy of the GNU General Public License |
---|
24 | | - * along with this program; if not, write to the Free Software |
---|
25 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
26 | 13 | */ |
---|
27 | 14 | |
---|
28 | 15 | /* |
---|
.. | .. |
---|
218 | 205 | static int asb100_read_value(struct i2c_client *client, u16 reg); |
---|
219 | 206 | static void asb100_write_value(struct i2c_client *client, u16 reg, u16 val); |
---|
220 | 207 | |
---|
221 | | -static int asb100_probe(struct i2c_client *client, |
---|
222 | | - const struct i2c_device_id *id); |
---|
| 208 | +static int asb100_probe(struct i2c_client *client); |
---|
223 | 209 | static int asb100_detect(struct i2c_client *client, |
---|
224 | 210 | struct i2c_board_info *info); |
---|
225 | 211 | static int asb100_remove(struct i2c_client *client); |
---|
.. | .. |
---|
237 | 223 | .driver = { |
---|
238 | 224 | .name = "asb100", |
---|
239 | 225 | }, |
---|
240 | | - .probe = asb100_probe, |
---|
| 226 | + .probe_new = asb100_probe, |
---|
241 | 227 | .remove = asb100_remove, |
---|
242 | 228 | .id_table = asb100_id, |
---|
243 | 229 | .detect = asb100_detect, |
---|
.. | .. |
---|
719 | 705 | goto ERROR_SC_2; |
---|
720 | 706 | } |
---|
721 | 707 | |
---|
722 | | - data->lm75[0] = i2c_new_dummy(adapter, sc_addr[0]); |
---|
723 | | - if (!data->lm75[0]) { |
---|
| 708 | + data->lm75[0] = i2c_new_dummy_device(adapter, sc_addr[0]); |
---|
| 709 | + if (IS_ERR(data->lm75[0])) { |
---|
724 | 710 | dev_err(&client->dev, |
---|
725 | 711 | "subclient %d registration at address 0x%x failed.\n", |
---|
726 | 712 | 1, sc_addr[0]); |
---|
727 | | - err = -ENOMEM; |
---|
| 713 | + err = PTR_ERR(data->lm75[0]); |
---|
728 | 714 | goto ERROR_SC_2; |
---|
729 | 715 | } |
---|
730 | 716 | |
---|
731 | | - data->lm75[1] = i2c_new_dummy(adapter, sc_addr[1]); |
---|
732 | | - if (!data->lm75[1]) { |
---|
| 717 | + data->lm75[1] = i2c_new_dummy_device(adapter, sc_addr[1]); |
---|
| 718 | + if (IS_ERR(data->lm75[1])) { |
---|
733 | 719 | dev_err(&client->dev, |
---|
734 | 720 | "subclient %d registration at address 0x%x failed.\n", |
---|
735 | 721 | 2, sc_addr[1]); |
---|
736 | | - err = -ENOMEM; |
---|
| 722 | + err = PTR_ERR(data->lm75[1]); |
---|
737 | 723 | goto ERROR_SC_3; |
---|
738 | 724 | } |
---|
739 | 725 | |
---|
.. | .. |
---|
788 | 774 | return 0; |
---|
789 | 775 | } |
---|
790 | 776 | |
---|
791 | | -static int asb100_probe(struct i2c_client *client, |
---|
792 | | - const struct i2c_device_id *id) |
---|
| 777 | +static int asb100_probe(struct i2c_client *client) |
---|
793 | 778 | { |
---|
794 | 779 | int err; |
---|
795 | 780 | struct asb100_data *data; |
---|