hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/nfc/fdp/i2c.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* -------------------------------------------------------------------------
23 * Copyright (C) 2014-2016, Intel Corporation
34 *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 * -------------------------------------------------------------------------
146 */
157
....@@ -57,7 +49,6 @@
5749 {
5850 struct fdp_i2c_phy *phy = phy_id;
5951
60
- dev_dbg(&phy->i2c_dev->dev, "%s\n", __func__);
6152 fdp_nci_i2c_reset(phy);
6253
6354 return 0;
....@@ -67,7 +58,6 @@
6758 {
6859 struct fdp_i2c_phy *phy = phy_id;
6960
70
- dev_dbg(&phy->i2c_dev->dev, "%s\n", __func__);
7161 fdp_nci_i2c_reset(phy);
7262 }
7363
....@@ -205,7 +195,6 @@
205195 static irqreturn_t fdp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
206196 {
207197 struct fdp_i2c_phy *phy = phy_id;
208
- struct i2c_client *client;
209198 struct sk_buff *skb;
210199 int r;
211200
....@@ -213,9 +202,6 @@
213202 WARN_ON_ONCE(1);
214203 return IRQ_NONE;
215204 }
216
-
217
- client = phy->i2c_dev;
218
- dev_dbg(&client->dev, "%s\n", __func__);
219205
220206 r = fdp_nci_i2c_read(phy, &skb);
221207
....@@ -225,7 +211,7 @@
225211 return IRQ_HANDLED;
226212
227213 if (skb != NULL)
228
- fdp_nci_recv_frame(phy->ndev, skb);
214
+ nci_recv_frame(phy->ndev, skb);
229215
230216 return IRQ_HANDLED;
231217 }
....@@ -263,6 +249,9 @@
263249 len, sizeof(**fw_vsc_cfg),
264250 GFP_KERNEL);
265251
252
+ if (!*fw_vsc_cfg)
253
+ goto alloc_err;
254
+
266255 r = device_property_read_u8_array(dev, FDP_DP_FW_VSC_CFG_NAME,
267256 *fw_vsc_cfg, len);
268257
....@@ -276,6 +265,7 @@
276265 *fw_vsc_cfg = NULL;
277266 }
278267
268
+alloc_err:
279269 dev_dbg(dev, "Clock type: %d, clock frequency: %d, VSC: %s",
280270 *clock_type, *clock_freq, *fw_vsc_cfg != NULL ? "yes" : "no");
281271 }
....@@ -295,8 +285,6 @@
295285 u8 clock_type;
296286 u32 clock_freq;
297287 int r = 0;
298
-
299
- dev_dbg(dev, "%s\n", __func__);
300288
301289 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
302290 nfc_err(dev, "No I2C_FUNC_I2C support\n");
....@@ -358,8 +346,6 @@
358346 static int fdp_nci_i2c_remove(struct i2c_client *client)
359347 {
360348 struct fdp_i2c_phy *phy = i2c_get_clientdata(client);
361
-
362
- dev_dbg(&client->dev, "%s\n", __func__);
363349
364350 fdp_nci_remove(phy->ndev);
365351 fdp_nci_i2c_disable(phy);