hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/input/mouse/psmouse-smbus.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2017 Red Hat, Inc
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms of the GNU General Public License version 2 as published by
6
- * the Free Software Foundation.
74 */
85
96 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -193,6 +190,7 @@
193190 struct psmouse_smbus_dev *smbdev = data;
194191 unsigned short addr_list[] = { smbdev->board.addr, I2C_CLIENT_END };
195192 struct i2c_adapter *adapter;
193
+ struct i2c_client *client;
196194
197195 adapter = i2c_verify_adapter(dev);
198196 if (!adapter)
....@@ -201,12 +199,13 @@
201199 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_HOST_NOTIFY))
202200 return 0;
203201
204
- smbdev->client = i2c_new_probed_device(adapter, &smbdev->board,
205
- addr_list, NULL);
206
- if (!smbdev->client)
202
+ client = i2c_new_scanned_device(adapter, &smbdev->board,
203
+ addr_list, NULL);
204
+ if (IS_ERR(client))
207205 return 0;
208206
209207 /* We have our(?) device, stop iterating i2c bus. */
208
+ smbdev->client = client;
210209 return 1;
211210 }
212211