@@ -256,48 +256,10 @@ static const struct acpi_gpio_mapping acpi_nxp_nci_gpios[] = {
256
256
{ }
257
257
};
258
258
259
- static int nxp_nci_i2c_parse_devtree (struct i2c_client * client )
260
- {
261
- struct nxp_nci_i2c_phy * phy = i2c_get_clientdata (client );
262
-
263
- phy -> gpiod_en = devm_gpiod_get (& client -> dev , "enable" , GPIOD_OUT_LOW );
264
- if (IS_ERR (phy -> gpiod_en )) {
265
- nfc_err (& client -> dev , "Failed to get EN gpio\n" );
266
- return PTR_ERR (phy -> gpiod_en );
267
- }
268
-
269
- phy -> gpiod_fw = devm_gpiod_get (& client -> dev , "firmware" , GPIOD_OUT_LOW );
270
- if (IS_ERR (phy -> gpiod_fw )) {
271
- nfc_err (& client -> dev , "Failed to get FW gpio\n" );
272
- return PTR_ERR (phy -> gpiod_fw );
273
- }
274
-
275
- return 0 ;
276
- }
277
-
278
- static int nxp_nci_i2c_acpi_config (struct nxp_nci_i2c_phy * phy )
279
- {
280
- struct i2c_client * client = phy -> i2c_dev ;
281
- int r ;
282
-
283
- r = devm_acpi_dev_add_driver_gpios (& client -> dev , acpi_nxp_nci_gpios );
284
- if (r )
285
- return r ;
286
-
287
- phy -> gpiod_en = devm_gpiod_get (& client -> dev , "enable" , GPIOD_OUT_LOW );
288
- phy -> gpiod_fw = devm_gpiod_get (& client -> dev , "firmware" , GPIOD_OUT_LOW );
289
-
290
- if (IS_ERR (phy -> gpiod_en ) || IS_ERR (phy -> gpiod_fw )) {
291
- nfc_err (& client -> dev , "No GPIOs\n" );
292
- return - EINVAL ;
293
- }
294
-
295
- return 0 ;
296
- }
297
-
298
259
static int nxp_nci_i2c_probe (struct i2c_client * client ,
299
260
const struct i2c_device_id * id )
300
261
{
262
+ struct device * dev = & client -> dev ;
301
263
struct nxp_nci_i2c_phy * phy ;
302
264
int r ;
303
265
@@ -317,20 +279,20 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
317
279
phy -> i2c_dev = client ;
318
280
i2c_set_clientdata (client , phy );
319
281
320
- if ( client -> dev . of_node ) {
321
- r = nxp_nci_i2c_parse_devtree ( client );
322
- if ( r < 0 ) {
323
- nfc_err ( & client -> dev , "Failed to get DT data\n" );
324
- goto probe_exit ;
325
- }
326
- } else if ( ACPI_HANDLE ( & client -> dev )) {
327
- r = nxp_nci_i2c_acpi_config (phy );
328
- if ( r < 0 )
329
- goto probe_exit ;
330
- } else {
331
- nfc_err ( & client -> dev , "No platform data\n" );
332
- r = - EINVAL ;
333
- goto probe_exit ;
282
+ r = devm_acpi_dev_add_driver_gpios ( dev , acpi_nxp_nci_gpios );
283
+ if ( r )
284
+ return r ;
285
+
286
+ phy -> gpiod_en = devm_gpiod_get ( dev , "enable" , GPIOD_OUT_LOW ) ;
287
+ if ( IS_ERR ( phy -> gpiod_en )) {
288
+ nfc_err ( dev , "Failed to get EN gpio\n" );
289
+ return PTR_ERR (phy -> gpiod_en );
290
+ }
291
+
292
+ phy -> gpiod_fw = devm_gpiod_get ( dev , "firmware" , GPIOD_OUT_LOW );
293
+ if ( IS_ERR ( phy -> gpiod_fw )) {
294
+ nfc_err ( dev , "Failed to get FW gpio\n" ) ;
295
+ return PTR_ERR ( phy -> gpiod_fw ) ;
334
296
}
335
297
336
298
r = nxp_nci_probe (phy , & client -> dev , & i2c_phy_ops ,
0 commit comments