3030#include <linux/nfc.h>
3131#include <linux/firmware.h>
3232#include <linux/gpio/consumer.h>
33- #include <linux/platform_data/pn544.h>
33+
3434#include <asm/unaligned.h>
3535
3636#include <net/nfc/hci.h>
@@ -972,7 +972,6 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
972972 const struct i2c_device_id * id )
973973{
974974 struct pn544_i2c_phy * phy ;
975- struct pn544_nfc_platform_data * pdata ;
976975 int r = 0 ;
977976
978977 dev_dbg (& client -> dev , "%s\n" , __func__ );
@@ -994,32 +993,13 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
994993 phy -> i2c_dev = client ;
995994 i2c_set_clientdata (client , phy );
996995
997- pdata = client -> dev .platform_data ;
998-
999996 /* No platform data, using device tree. */
1000- if (! pdata && client -> dev .of_node ) {
997+ if (client -> dev .of_node ) {
1001998 r = pn544_hci_i2c_of_request_resources (client );
1002999 if (r ) {
10031000 nfc_err (& client -> dev , "No DT data\n" );
10041001 return r ;
10051002 }
1006- /* Using platform data. */
1007- } else if (pdata ) {
1008-
1009- if (pdata -> request_resources == NULL ) {
1010- nfc_err (& client -> dev , "request_resources() missing\n" );
1011- return - EINVAL ;
1012- }
1013-
1014- r = pdata -> request_resources (client );
1015- if (r ) {
1016- nfc_err (& client -> dev ,
1017- "Cannot get platform resources\n" );
1018- return r ;
1019- }
1020-
1021- phy -> gpio_en = pdata -> get_gpio (NFC_GPIO_ENABLE );
1022- phy -> gpio_fw = pdata -> get_gpio (NFC_GPIO_FW_RESET );
10231003 /* Using ACPI */
10241004 } else if (ACPI_HANDLE (& client -> dev )) {
10251005 r = pn544_hci_i2c_acpi_request_resources (client );
@@ -1056,20 +1036,15 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
10561036 free_irq (client -> irq , phy );
10571037
10581038err_rti :
1059- if (!pdata ) {
1060- gpio_free (phy -> gpio_en );
1061- gpio_free (phy -> gpio_fw );
1062- } else if (pdata -> free_resources ) {
1063- pdata -> free_resources ();
1064- }
1039+ gpio_free (phy -> gpio_en );
1040+ gpio_free (phy -> gpio_fw );
10651041
10661042 return r ;
10671043}
10681044
10691045static int pn544_hci_i2c_remove (struct i2c_client * client )
10701046{
10711047 struct pn544_i2c_phy * phy = i2c_get_clientdata (client );
1072- struct pn544_nfc_platform_data * pdata = client -> dev .platform_data ;
10731048
10741049 dev_dbg (& client -> dev , "%s\n" , __func__ );
10751050
@@ -1084,14 +1059,8 @@ static int pn544_hci_i2c_remove(struct i2c_client *client)
10841059
10851060 free_irq (client -> irq , phy );
10861061
1087- /* No platform data, GPIOs have been requested by this driver */
1088- if (!pdata ) {
1089- gpio_free (phy -> gpio_en );
1090- gpio_free (phy -> gpio_fw );
1091- /* Using platform data */
1092- } else if (pdata -> free_resources ) {
1093- pdata -> free_resources ();
1094- }
1062+ gpio_free (phy -> gpio_en );
1063+ gpio_free (phy -> gpio_fw );
10951064
10961065 return 0 ;
10971066}
0 commit comments