hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/i2c/busses/i2c-taos-evm.c
....@@ -1,18 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for the TAOS evaluation modules
34 * These devices include an I2C master which can be controlled over the
45 * serial port.
56 *
67 * Copyright (C) 2007 Jean Delvare <jdelvare@suse.de>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; version 2 of the License.
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.
168 */
179
1810 #include <linux/delay.h>
....@@ -47,7 +39,7 @@
4739 };
4840
4941 /* TAOS TSL2550 EVM */
50
-static struct i2c_board_info tsl2550_info = {
42
+static const struct i2c_board_info tsl2550_info = {
5143 I2C_BOARD_INFO("tsl2550", 0x39),
5244 };
5345
....@@ -57,10 +49,10 @@
5749 if (!strncmp(adapter->name, "TAOS TSL2550 EVM", 16)) {
5850 dev_info(&adapter->dev, "Instantiating device %s at 0x%02x\n",
5951 tsl2550_info.type, tsl2550_info.addr);
60
- return i2c_new_device(adapter, &tsl2550_info);
52
+ return i2c_new_client_device(adapter, &tsl2550_info);
6153 }
6254
63
- return NULL;
55
+ return ERR_PTR(-ENODEV);
6456 }
6557
6658 static int taos_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
....@@ -133,7 +125,7 @@
133125 /*
134126 * Voluntarily dropping error code of kstrtou8 since all
135127 * error code that it could return are invalid according
136
- * to Documentation/i2c/fault-codes.
128
+ * to Documentation/i2c/fault-codes.rst.
137129 */
138130 if (kstrtou8(p + 1, 16, &data->byte))
139131 return -EPROTO;