summaryrefslogtreecommitdiff
path: root/drivers/nfc/pn533/pn533.c
diff options
context:
space:
mode:
authorMichael Thalmeier <michael.thalmeier@hale.at>2016-04-21 16:43:50 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2016-05-09 23:59:18 +0200
commitb16931b13c67f06ca74cc8d02797de480dea348b (patch)
tree11240279a0355fc5f7e485d84fff85a3927d9357 /drivers/nfc/pn533/pn533.c
parent79f09fa79cefdd9df40c9c590cc8dda544ebff26 (diff)
NFC: pn533: fix order of initialization
Correctly call nfc_set_parent_dev before nfc_register_device. Otherwise the driver will OOPS when being removed. Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/pn533/pn533.c')
-rw-r--r--drivers/nfc/pn533/pn533.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
index ee9e8f1195fa..d82eecd8daad 100644
--- a/drivers/nfc/pn533/pn533.c
+++ b/drivers/nfc/pn533/pn533.c
@@ -2554,7 +2554,8 @@ struct pn533 *pn533_register_device(u32 device_type,
void *phy,
struct pn533_phy_ops *phy_ops,
struct pn533_frame_ops *fops,
- struct device *dev)
+ struct device *dev,
+ struct device *parent)
{
struct pn533_fw_version fw_ver;
struct pn533 *priv;
@@ -2617,6 +2618,7 @@ struct pn533 *pn533_register_device(u32 device_type,
goto destroy_wq;
}
+ nfc_set_parent_dev(priv->nfc_dev, parent);
nfc_set_drvdata(priv->nfc_dev, priv);
rc = nfc_register_device(priv->nfc_dev);