summaryrefslogtreecommitdiff
path: root/drivers/nfc/pn533/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nfc/pn533/uart.c')
-rw-r--r--drivers/nfc/pn533/uart.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c
index a0665d8ea85b..a081bce61c29 100644
--- a/drivers/nfc/pn533/uart.c
+++ b/drivers/nfc/pn533/uart.c
@@ -123,7 +123,7 @@ static int pn532_dev_down(struct pn533 *dev)
return 0;
}
-static struct pn533_phy_ops uart_phy_ops = {
+static const struct pn533_phy_ops uart_phy_ops = {
.send_frame = pn532_uart_send_frame,
.send_ack = pn532_uart_send_ack,
.abort_cmd = pn532_uart_abort_cmd,
@@ -133,7 +133,7 @@ static struct pn533_phy_ops uart_phy_ops = {
static void pn532_cmd_timeout(struct timer_list *t)
{
- struct pn532_uart_phy *dev = from_timer(dev, t, cmd_timeout);
+ struct pn532_uart_phy *dev = timer_container_of(dev, t, cmd_timeout);
pn532_uart_send_frame(dev->priv, dev->cur_out_buf);
}
@@ -203,13 +203,13 @@ static int pn532_uart_rx_is_frame(struct sk_buff *skb)
return 0;
}
-static int pn532_receive_buf(struct serdev_device *serdev,
- const unsigned char *data, size_t count)
+static size_t pn532_receive_buf(struct serdev_device *serdev,
+ const u8 *data, size_t count)
{
struct pn532_uart_phy *dev = serdev_device_get_drvdata(serdev);
size_t i;
- del_timer(&dev->cmd_timeout);
+ timer_delete(&dev->cmd_timeout);
for (i = 0; i < count; i++) {
skb_put_u8(dev->recv_skb, *data++);
if (!pn532_uart_rx_is_frame(dev->recv_skb))
@@ -224,7 +224,7 @@ static int pn532_receive_buf(struct serdev_device *serdev,
return i;
}
-static struct serdev_device_ops pn532_serdev_ops = {
+static const struct serdev_device_ops pn532_serdev_ops = {
.receive_buf = pn532_receive_buf,
.write_wakeup = serdev_device_write_wakeup,
};
@@ -310,6 +310,7 @@ static void pn532_uart_remove(struct serdev_device *serdev)
pn53x_unregister_nfc(pn532->priv);
serdev_device_close(serdev);
pn53x_common_clean(pn532->priv);
+ timer_shutdown_sync(&pn532->cmd_timeout);
kfree_skb(pn532->recv_skb);
kfree(pn532);
}
@@ -319,7 +320,7 @@ static struct serdev_device_driver pn532_uart_driver = {
.remove = pn532_uart_remove,
.driver = {
.name = "pn532_uart",
- .of_match_table = of_match_ptr(pn532_uart_of_match),
+ .of_match_table = pn532_uart_of_match,
},
};