hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/asb100.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * asb100.c - Part of lm_sensors, Linux kernel modules for hardware
34 * monitoring
....@@ -9,20 +10,6 @@
910 * Copyright (C) 1998 - 2003 Frodo Looijaard <frodol@dds.nl>,
1011 * Philip Edelbrock <phil@netroedge.com>, and
1112 * 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.
2613 */
2714
2815 /*
....@@ -218,8 +205,7 @@
218205 static int asb100_read_value(struct i2c_client *client, u16 reg);
219206 static void asb100_write_value(struct i2c_client *client, u16 reg, u16 val);
220207
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);
223209 static int asb100_detect(struct i2c_client *client,
224210 struct i2c_board_info *info);
225211 static int asb100_remove(struct i2c_client *client);
....@@ -237,7 +223,7 @@
237223 .driver = {
238224 .name = "asb100",
239225 },
240
- .probe = asb100_probe,
226
+ .probe_new = asb100_probe,
241227 .remove = asb100_remove,
242228 .id_table = asb100_id,
243229 .detect = asb100_detect,
....@@ -719,21 +705,21 @@
719705 goto ERROR_SC_2;
720706 }
721707
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])) {
724710 dev_err(&client->dev,
725711 "subclient %d registration at address 0x%x failed.\n",
726712 1, sc_addr[0]);
727
- err = -ENOMEM;
713
+ err = PTR_ERR(data->lm75[0]);
728714 goto ERROR_SC_2;
729715 }
730716
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])) {
733719 dev_err(&client->dev,
734720 "subclient %d registration at address 0x%x failed.\n",
735721 2, sc_addr[1]);
736
- err = -ENOMEM;
722
+ err = PTR_ERR(data->lm75[1]);
737723 goto ERROR_SC_3;
738724 }
739725
....@@ -788,8 +774,7 @@
788774 return 0;
789775 }
790776
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)
793778 {
794779 int err;
795780 struct asb100_data *data;