Skip to content

Commit 79557b3

Browse files
andy-shevSamuel Ortiz
authored andcommitted
NFC: st21nfca: Get rid of platform data
Legacy platform data must go away. We are on the safe side here since there are no users of it in the kernel. If anyone by any odd reason needs it the GPIO lookup tables and built-in device properties at your service. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent bacf2a6 commit 79557b3

File tree

2 files changed

+3
-76
lines changed

2 files changed

+3
-76
lines changed

drivers/nfc/st21nfca/i2c.c

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/crc-ccitt.h>
2121
#include <linux/module.h>
2222
#include <linux/i2c.h>
23-
#include <linux/gpio.h>
2423
#include <linux/gpio/consumer.h>
2524
#include <linux/of_irq.h>
2625
#include <linux/of_gpio.h>
@@ -29,7 +28,7 @@
2928
#include <linux/delay.h>
3029
#include <linux/nfc.h>
3130
#include <linux/firmware.h>
32-
#include <linux/platform_data/st21nfca.h>
31+
3332
#include <asm/unaligned.h>
3433

3534
#include <net/nfc/hci.h>
@@ -59,6 +58,7 @@
5958
#define IS_START_OF_FRAME(buf) (buf[0] == ST21NFCA_SOF_EOF && \
6059
buf[1] == 0)
6160

61+
#define ST21NFCA_HCI_DRIVER_NAME "st21nfca_hci"
6262
#define ST21NFCA_HCI_I2C_DRIVER_NAME "st21nfca_hci_i2c"
6363

6464
#define ST21NFCA_GPIO_NAME_EN "enable"
@@ -576,43 +576,10 @@ static int st21nfca_hci_i2c_of_request_resources(struct i2c_client *client)
576576
return 0;
577577
}
578578

579-
static int st21nfca_hci_i2c_request_resources(struct i2c_client *client)
580-
{
581-
struct st21nfca_nfc_platform_data *pdata;
582-
struct st21nfca_i2c_phy *phy = i2c_get_clientdata(client);
583-
int r;
584-
585-
pdata = client->dev.platform_data;
586-
if (pdata == NULL) {
587-
nfc_err(&client->dev, "No platform data\n");
588-
return -EINVAL;
589-
}
590-
591-
/* store for later use */
592-
phy->gpio_ena = pdata->gpio_ena;
593-
phy->irq_polarity = pdata->irq_polarity;
594-
595-
if (phy->gpio_ena > 0) {
596-
r = devm_gpio_request_one(&client->dev, phy->gpio_ena,
597-
GPIOF_OUT_INIT_HIGH,
598-
ST21NFCA_GPIO_NAME_EN);
599-
if (r) {
600-
pr_err("%s : ena gpio_request failed\n", __FILE__);
601-
return r;
602-
}
603-
}
604-
605-
phy->se_status.is_ese_present = pdata->is_ese_present;
606-
phy->se_status.is_uicc_present = pdata->is_uicc_present;
607-
608-
return 0;
609-
}
610-
611579
static int st21nfca_hci_i2c_probe(struct i2c_client *client,
612580
const struct i2c_device_id *id)
613581
{
614582
struct st21nfca_i2c_phy *phy;
615-
struct st21nfca_nfc_platform_data *pdata;
616583
int r;
617584

618585
dev_dbg(&client->dev, "%s\n", __func__);
@@ -638,19 +605,12 @@ static int st21nfca_hci_i2c_probe(struct i2c_client *client,
638605
mutex_init(&phy->phy_lock);
639606
i2c_set_clientdata(client, phy);
640607

641-
pdata = client->dev.platform_data;
642-
if (!pdata && client->dev.of_node) {
608+
if (client->dev.of_node) {
643609
r = st21nfca_hci_i2c_of_request_resources(client);
644610
if (r) {
645611
nfc_err(&client->dev, "No platform data\n");
646612
return r;
647613
}
648-
} else if (pdata) {
649-
r = st21nfca_hci_i2c_request_resources(client);
650-
if (r) {
651-
nfc_err(&client->dev, "Cannot get platform resources\n");
652-
return r;
653-
}
654614
} else if (ACPI_HANDLE(&client->dev)) {
655615
r = st21nfca_hci_i2c_acpi_request_resources(client);
656616
if (r) {

include/linux/platform_data/st21nfca.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)