hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/hwmon/pmbus/zl6100.c
....@@ -1,22 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Hardware monitoring driver for ZL6100 and compatibles
34 *
45 * Copyright (c) 2011 Ericsson AB.
56 * Copyright (c) 2012 Guenter Roeck
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
207 */
218
229 #include <linux/bitops.h>
....@@ -138,7 +125,8 @@
138125 }
139126 }
140127
141
-static int zl6100_read_word_data(struct i2c_client *client, int page, int reg)
128
+static int zl6100_read_word_data(struct i2c_client *client, int page,
129
+ int phase, int reg)
142130 {
143131 const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
144132 struct zl6100_data *data = to_zl6100_data(info);
....@@ -180,7 +168,7 @@
180168 }
181169
182170 zl6100_wait(data);
183
- ret = pmbus_read_word_data(client, page, vreg);
171
+ ret = pmbus_read_word_data(client, page, phase, vreg);
184172 data->access = ktime_get();
185173 if (ret < 0)
186174 return ret;
....@@ -313,8 +301,7 @@
313301 };
314302 MODULE_DEVICE_TABLE(i2c, zl6100_id);
315303
316
-static int zl6100_probe(struct i2c_client *client,
317
- const struct i2c_device_id *id)
304
+static int zl6100_probe(struct i2c_client *client)
318305 {
319306 int ret;
320307 struct zl6100_data *data;
....@@ -345,10 +332,10 @@
345332 dev_err(&client->dev, "Unsupported device\n");
346333 return -ENODEV;
347334 }
348
- if (id->driver_data != mid->driver_data)
335
+ if (strcmp(client->name, mid->name) != 0)
349336 dev_notice(&client->dev,
350337 "Device mismatch: Configured %s, detected %s\n",
351
- id->name, mid->name);
338
+ client->name, mid->name);
352339
353340 data = devm_kzalloc(&client->dev, sizeof(struct zl6100_data),
354341 GFP_KERNEL);
....@@ -401,14 +388,14 @@
401388 info->write_word_data = zl6100_write_word_data;
402389 info->write_byte = zl6100_write_byte;
403390
404
- return pmbus_do_probe(client, mid, info);
391
+ return pmbus_do_probe(client, info);
405392 }
406393
407394 static struct i2c_driver zl6100_driver = {
408395 .driver = {
409396 .name = "zl6100",
410397 },
411
- .probe = zl6100_probe,
398
+ .probe_new = zl6100_probe,
412399 .remove = pmbus_do_remove,
413400 .id_table = zl6100_id,
414401 };