Commit f4fa6e6d authored by David S. Miller's avatar David S. Miller

Merge tag 'nfc-next-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next

Samuel Ortiz says:

====================
NFC 4.6 pull request

This is a very small one this time, with only 5 patches.
There are a couple of big items that could not be merged/finished
on time.

We have:

- 2 LLCP fixes for a race and a potential OOM.
- 2 cleanups for the pn544 and microread drivers.
- 1 Maintainer addition for the s3fwrn5 driver.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 01099881 079c2652
...@@ -7666,7 +7666,6 @@ F: net/nfc/ ...@@ -7666,7 +7666,6 @@ F: net/nfc/
F: include/net/nfc/ F: include/net/nfc/
F: include/uapi/linux/nfc.h F: include/uapi/linux/nfc.h
F: drivers/nfc/ F: drivers/nfc/
F: include/linux/platform_data/microread.h
F: include/linux/platform_data/nfcmrvl.h F: include/linux/platform_data/nfcmrvl.h
F: include/linux/platform_data/nxp-nci.h F: include/linux/platform_data/nxp-nci.h
F: include/linux/platform_data/pn544.h F: include/linux/platform_data/pn544.h
...@@ -9509,6 +9508,7 @@ F: drivers/media/i2c/s5k5baf.c ...@@ -9509,6 +9508,7 @@ F: drivers/media/i2c/s5k5baf.c
SAMSUNG S3FWRN5 NFC DRIVER SAMSUNG S3FWRN5 NFC DRIVER
M: Robert Baldyga <r.baldyga@samsung.com> M: Robert Baldyga <r.baldyga@samsung.com>
M: Krzysztof Opasiak <k.opasiak@samsung.com>
L: linux-nfc@lists.01.org (moderated for non-subscribers) L: linux-nfc@lists.01.org (moderated for non-subscribers)
S: Supported S: Supported
F: drivers/nfc/s3fwrn5 F: drivers/nfc/s3fwrn5
......
...@@ -246,18 +246,10 @@ static int microread_i2c_probe(struct i2c_client *client, ...@@ -246,18 +246,10 @@ static int microread_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct microread_i2c_phy *phy; struct microread_i2c_phy *phy;
struct microread_nfc_platform_data *pdata =
dev_get_platdata(&client->dev);
int r; int r;
dev_dbg(&client->dev, "client %p\n", client); dev_dbg(&client->dev, "client %p\n", client);
if (!pdata) {
nfc_err(&client->dev, "client %p: missing platform data\n",
client);
return -EINVAL;
}
phy = devm_kzalloc(&client->dev, sizeof(struct microread_i2c_phy), phy = devm_kzalloc(&client->dev, sizeof(struct microread_i2c_phy),
GFP_KERNEL); GFP_KERNEL);
if (!phy) if (!phy)
......
...@@ -877,20 +877,8 @@ static void pn544_hci_i2c_fw_work(struct work_struct *work) ...@@ -877,20 +877,8 @@ static void pn544_hci_i2c_fw_work(struct work_struct *work)
static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client) static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client)
{ {
struct pn544_i2c_phy *phy = i2c_get_clientdata(client); struct pn544_i2c_phy *phy = i2c_get_clientdata(client);
const struct acpi_device_id *id;
struct gpio_desc *gpiod_en, *gpiod_fw; struct gpio_desc *gpiod_en, *gpiod_fw;
struct device *dev; struct device *dev = &client->dev;
if (!client)
return -EINVAL;
dev = &client->dev;
/* Match the struct device against a given list of ACPI IDs */
id = acpi_match_device(dev->driver->acpi_match_table, dev);
if (!id)
return -ENODEV;
/* Get EN GPIO from ACPI */ /* Get EN GPIO from ACPI */
gpiod_en = devm_gpiod_get_index(dev, PN544_GPIO_NAME_EN, 1, gpiod_en = devm_gpiod_get_index(dev, PN544_GPIO_NAME_EN, 1,
......
/*
* Driver include for the Inside Secure microread NFC Chip.
*
* Copyright (C) 2011 Tieto Poland
* Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _MICROREAD_H
#define _MICROREAD_H
#include <linux/i2c.h>
#define MICROREAD_DRIVER_NAME "microread"
/* board config platform data for microread */
struct microread_nfc_platform_data {
unsigned int rst_gpio;
unsigned int irq_gpio;
unsigned int ioh_gpio;
};
#endif /* _MICROREAD_H */
...@@ -663,7 +663,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, ...@@ -663,7 +663,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
return -ENOBUFS; return -ENOBUFS;
} }
msg_data = kzalloc(len, GFP_KERNEL); msg_data = kmalloc(len, GFP_USER | __GFP_NOWARN);
if (msg_data == NULL) if (msg_data == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -729,7 +729,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap, ...@@ -729,7 +729,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
if (local == NULL) if (local == NULL)
return -ENODEV; return -ENODEV;
msg_data = kzalloc(len, GFP_KERNEL); msg_data = kmalloc(len, GFP_USER | __GFP_NOWARN);
if (msg_data == NULL) if (msg_data == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -509,6 +509,11 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -509,6 +509,11 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
memset(llcp_addr, 0, sizeof(*llcp_addr)); memset(llcp_addr, 0, sizeof(*llcp_addr));
*len = sizeof(struct sockaddr_nfc_llcp); *len = sizeof(struct sockaddr_nfc_llcp);
lock_sock(sk);
if (!llcp_sock->dev) {
release_sock(sk);
return -EBADFD;
}
llcp_addr->sa_family = AF_NFC; llcp_addr->sa_family = AF_NFC;
llcp_addr->dev_idx = llcp_sock->dev->idx; llcp_addr->dev_idx = llcp_sock->dev->idx;
llcp_addr->target_idx = llcp_sock->target_idx; llcp_addr->target_idx = llcp_sock->target_idx;
...@@ -518,6 +523,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -518,6 +523,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
llcp_addr->service_name_len = llcp_sock->service_name_len; llcp_addr->service_name_len = llcp_sock->service_name_len;
memcpy(llcp_addr->service_name, llcp_sock->service_name, memcpy(llcp_addr->service_name, llcp_sock->service_name,
llcp_addr->service_name_len); llcp_addr->service_name_len);
release_sock(sk);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment