1818 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1919 */
2020
21+ #define pr_fmt (fmt ) KBUILD_MODNAME ": " fmt
22+
2123#include <linux/crc-ccitt.h>
2224#include <linux/module.h>
2325#include <linux/i2c.h>
@@ -151,8 +153,7 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
151153 char rset_cmd [] = { 0x05 , 0xF9 , 0x04 , 0x00 , 0xC3 , 0xE5 };
152154 int count = sizeof (rset_cmd );
153155
154- pr_info (DRIVER_DESC ": %s\n" , __func__ );
155- dev_info (& phy -> i2c_dev -> dev , "Detecting nfc_en polarity\n" );
156+ nfc_info (& phy -> i2c_dev -> dev , "Detecting nfc_en polarity\n" );
156157
157158 /* Disable fw download */
158159 gpio_set_value (phy -> gpio_fw , 0 );
@@ -173,15 +174,15 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
173174 dev_dbg (& phy -> i2c_dev -> dev , "Sending reset cmd\n" );
174175 ret = i2c_master_send (phy -> i2c_dev , rset_cmd , count );
175176 if (ret == count ) {
176- dev_info (& phy -> i2c_dev -> dev ,
177+ nfc_info (& phy -> i2c_dev -> dev ,
177178 "nfc_en polarity : active %s\n" ,
178179 (polarity == 0 ? "low" : "high" ));
179180 goto out ;
180181 }
181182 }
182183 }
183184
184- dev_err (& phy -> i2c_dev -> dev ,
185+ nfc_err (& phy -> i2c_dev -> dev ,
185186 "Could not detect nfc_en polarity, fallback to active high\n" );
186187
187188out :
@@ -201,7 +202,7 @@ static int pn544_hci_i2c_enable(void *phy_id)
201202{
202203 struct pn544_i2c_phy * phy = phy_id ;
203204
204- pr_info (DRIVER_DESC ": %s\n" , __func__ );
205+ pr_info (" %s\n" , __func__ );
205206
206207 pn544_hci_i2c_enable_mode (phy , PN544_HCI_MODE );
207208
@@ -214,8 +215,6 @@ static void pn544_hci_i2c_disable(void *phy_id)
214215{
215216 struct pn544_i2c_phy * phy = phy_id ;
216217
217- pr_info (DRIVER_DESC ": %s\n" , __func__ );
218-
219218 gpio_set_value (phy -> gpio_fw , 0 );
220219 gpio_set_value (phy -> gpio_en , !phy -> en_polarity );
221220 usleep_range (10000 , 15000 );
@@ -298,11 +297,9 @@ static int check_crc(u8 *buf, int buflen)
298297 crc = ~crc ;
299298
300299 if (buf [len - 2 ] != (crc & 0xff ) || buf [len - 1 ] != (crc >> 8 )) {
301- pr_err (PN544_HCI_I2C_DRIVER_NAME
302- ": CRC error 0x%x != 0x%x 0x%x\n" ,
300+ pr_err ("CRC error 0x%x != 0x%x 0x%x\n" ,
303301 crc , buf [len - 1 ], buf [len - 2 ]);
304-
305- pr_info (DRIVER_DESC ": %s : BAD CRC\n" , __func__ );
302+ pr_info ("%s: BAD CRC\n" , __func__ );
306303 print_hex_dump (KERN_DEBUG , "crc: " , DUMP_PREFIX_NONE ,
307304 16 , 2 , buf , buflen , false);
308305 return - EPERM ;
@@ -328,13 +325,13 @@ static int pn544_hci_i2c_read(struct pn544_i2c_phy *phy, struct sk_buff **skb)
328325
329326 r = i2c_master_recv (client , & len , 1 );
330327 if (r != 1 ) {
331- dev_err (& client -> dev , "cannot read len byte\n" );
328+ nfc_err (& client -> dev , "cannot read len byte\n" );
332329 return - EREMOTEIO ;
333330 }
334331
335332 if ((len < (PN544_HCI_I2C_LLC_MIN_SIZE - 1 )) ||
336333 (len > (PN544_HCI_I2C_LLC_MAX_SIZE - 1 ))) {
337- dev_err (& client -> dev , "invalid len byte\n" );
334+ nfc_err (& client -> dev , "invalid len byte\n" );
338335 r = - EBADMSG ;
339336 goto flush ;
340337 }
@@ -386,7 +383,7 @@ static int pn544_hci_i2c_fw_read_status(struct pn544_i2c_phy *phy)
386383
387384 r = i2c_master_recv (client , (char * ) & response , sizeof (response ));
388385 if (r != sizeof (response )) {
389- dev_err (& client -> dev , "cannot read fw status\n" );
386+ nfc_err (& client -> dev , "cannot read fw status\n" );
390387 return - EIO ;
391388 }
392389
@@ -478,8 +475,7 @@ static int pn544_hci_i2c_fw_download(void *phy_id, const char *firmware_name)
478475{
479476 struct pn544_i2c_phy * phy = phy_id ;
480477
481- pr_info (DRIVER_DESC ": Starting Firmware Download (%s)\n" ,
482- firmware_name );
478+ pr_info ("Starting Firmware Download (%s)\n" , firmware_name );
483479
484480 strcpy (phy -> firmware_name , firmware_name );
485481
@@ -493,7 +489,7 @@ static int pn544_hci_i2c_fw_download(void *phy_id, const char *firmware_name)
493489static void pn544_hci_i2c_fw_work_complete (struct pn544_i2c_phy * phy ,
494490 int result )
495491{
496- pr_info (DRIVER_DESC ": Firmware Download Complete, result=%d\n" , result );
492+ pr_info (" Firmware Download Complete, result=%d\n" , result );
497493
498494 pn544_hci_i2c_disable (phy );
499495
@@ -694,14 +690,14 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
694690 dev_dbg (& client -> dev , "IRQ: %d\n" , client -> irq );
695691
696692 if (!i2c_check_functionality (client -> adapter , I2C_FUNC_I2C )) {
697- dev_err (& client -> dev , "Need I2C_FUNC_I2C\n" );
693+ nfc_err (& client -> dev , "Need I2C_FUNC_I2C\n" );
698694 return - ENODEV ;
699695 }
700696
701697 phy = devm_kzalloc (& client -> dev , sizeof (struct pn544_i2c_phy ),
702698 GFP_KERNEL );
703699 if (!phy ) {
704- dev_err (& client -> dev ,
700+ nfc_err (& client -> dev ,
705701 "Cannot allocate memory for pn544 i2c phy.\n" );
706702 return - ENOMEM ;
707703 }
@@ -714,18 +710,18 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
714710
715711 pdata = client -> dev .platform_data ;
716712 if (pdata == NULL ) {
717- dev_err (& client -> dev , "No platform data\n" );
713+ nfc_err (& client -> dev , "No platform data\n" );
718714 return - EINVAL ;
719715 }
720716
721717 if (pdata -> request_resources == NULL ) {
722- dev_err (& client -> dev , "request_resources() missing\n" );
718+ nfc_err (& client -> dev , "request_resources() missing\n" );
723719 return - EINVAL ;
724720 }
725721
726722 r = pdata -> request_resources (client );
727723 if (r ) {
728- dev_err (& client -> dev , "Cannot get platform resources\n" );
724+ nfc_err (& client -> dev , "Cannot get platform resources\n" );
729725 return r ;
730726 }
731727
@@ -739,7 +735,7 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
739735 IRQF_TRIGGER_RISING | IRQF_ONESHOT ,
740736 PN544_HCI_I2C_DRIVER_NAME , phy );
741737 if (r < 0 ) {
742- dev_err (& client -> dev , "Unable to register IRQ handler\n" );
738+ nfc_err (& client -> dev , "Unable to register IRQ handler\n" );
743739 goto err_rti ;
744740 }
745741
0 commit comments