hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/nfc/s3fwrn5/i2c.c
....@@ -1,20 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * I2C Link Layer for Samsung S3FWRN5 NCI based Driver
34 *
45 * Copyright (C) 2015 Samsung Electrnoics
56 * Robert Baldyga <r.baldyga@samsung.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms and conditions of the GNU General Public License,
9
- * version 2 or later, as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
187 */
198
209 #include <linux/i2c.h>
....@@ -175,7 +164,6 @@
175164 static irqreturn_t s3fwrn5_i2c_irq_thread_fn(int irq, void *phy_id)
176165 {
177166 struct s3fwrn5_i2c_phy *phy = phy_id;
178
- int ret = 0;
179167
180168 if (!phy || !phy->ndev) {
181169 WARN_ON_ONCE(1);
....@@ -190,10 +178,9 @@
190178 switch (phy->mode) {
191179 case S3FWRN5_MODE_NCI:
192180 case S3FWRN5_MODE_FW:
193
- ret = s3fwrn5_i2c_read(phy);
181
+ s3fwrn5_i2c_read(phy);
194182 break;
195183 case S3FWRN5_MODE_COLD:
196
- ret = -EREMOTEIO;
197184 break;
198185 }
199186
....@@ -211,13 +198,21 @@
211198 if (!np)
212199 return -ENODEV;
213200
214
- phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
215
- if (!gpio_is_valid(phy->gpio_en))
216
- return -ENODEV;
201
+ phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0);
202
+ if (!gpio_is_valid(phy->gpio_en)) {
203
+ /* Support also deprecated property */
204
+ phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
205
+ if (!gpio_is_valid(phy->gpio_en))
206
+ return -ENODEV;
207
+ }
217208
218
- phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
219
- if (!gpio_is_valid(phy->gpio_fw_wake))
220
- return -ENODEV;
209
+ phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0);
210
+ if (!gpio_is_valid(phy->gpio_fw_wake)) {
211
+ /* Support also deprecated property */
212
+ phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
213
+ if (!gpio_is_valid(phy->gpio_fw_wake))
214
+ return -ENODEV;
215
+ }
221216
222217 return 0;
223218 }
....@@ -290,7 +285,6 @@
290285
291286 static struct i2c_driver s3fwrn5_i2c_driver = {
292287 .driver = {
293
- .owner = THIS_MODULE,
294288 .name = S3FWRN5_I2C_DRIVER_NAME,
295289 .of_match_table = of_match_ptr(of_s3fwrn5_i2c_match),
296290 },