hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/smm665.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for SMM665 Power Controller / Monitor
34 *
45 * Copyright (C) 2010 Ericsson AB.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; version 2 of the License.
96 *
107 * This driver should also work for SMM465, SMM764, and SMM766, but is untested
118 * for those chips. Only monitoring functionality is implemented.
....@@ -200,7 +197,7 @@
200197 if (rv != -ENXIO) {
201198 /*
202199 * We expect ENXIO to reflect NACK
203
- * (per Documentation/i2c/fault-codes).
200
+ * (per Documentation/i2c/fault-codes.rst).
204201 * Everything else is an error.
205202 */
206203 dev_dbg(&client->dev,
....@@ -565,8 +562,9 @@
565562
566563 ATTRIBUTE_GROUPS(smm665);
567564
568
-static int smm665_probe(struct i2c_client *client,
569
- const struct i2c_device_id *id)
565
+static const struct i2c_device_id smm665_id[];
566
+
567
+static int smm665_probe(struct i2c_client *client)
570568 {
571569 struct i2c_adapter *adapter = client->adapter;
572570 struct smm665_data *data;
....@@ -588,11 +586,11 @@
588586 mutex_init(&data->update_lock);
589587
590588 data->client = client;
591
- data->type = id->driver_data;
592
- data->cmdreg = i2c_new_dummy(adapter, (client->addr & ~SMM665_REGMASK)
589
+ data->type = i2c_match_id(smm665_id, client)->driver_data;
590
+ data->cmdreg = i2c_new_dummy_device(adapter, (client->addr & ~SMM665_REGMASK)
593591 | SMM665_CMDREG_BASE);
594
- if (!data->cmdreg)
595
- return -ENOMEM;
592
+ if (IS_ERR(data->cmdreg))
593
+ return PTR_ERR(data->cmdreg);
596594
597595 switch (data->type) {
598596 case smm465:
....@@ -697,7 +695,7 @@
697695 .driver = {
698696 .name = "smm665",
699697 },
700
- .probe = smm665_probe,
698
+ .probe_new = smm665_probe,
701699 .remove = smm665_remove,
702700 .id_table = smm665_id,
703701 };