]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/nfc/nfcwilink.c
Merge branch 'pm-cpuidle' into fixes
[karo-tx-linux.git] / drivers / nfc / nfcwilink.c
index 50b1ee41afc60e2a3789f1a4e26ab12ff811ce4e..3b731acbc408fbc807ea8ffa4eef9f0dc622e97f 100644 (file)
@@ -526,7 +526,7 @@ static int nfcwilink_probe(struct platform_device *pdev)
 
        nfc_dev_dbg(&pdev->dev, "probe entry");
 
-       drv = kzalloc(sizeof(struct nfcwilink), GFP_KERNEL);
+       drv = devm_kzalloc(&pdev->dev, sizeof(struct nfcwilink), GFP_KERNEL);
        if (!drv) {
                rc = -ENOMEM;
                goto exit;
@@ -542,12 +542,13 @@ static int nfcwilink_probe(struct platform_device *pdev)
 
        drv->ndev = nci_allocate_device(&nfcwilink_ops,
                                        protocols,
+                                       NFC_SE_NONE,
                                        NFCWILINK_HDR_LEN,
                                        0);
        if (!drv->ndev) {
                nfc_dev_err(&pdev->dev, "nci_allocate_device failed");
                rc = -ENOMEM;
-               goto free_exit;
+               goto exit;
        }
 
        nci_set_parent_dev(drv->ndev, &pdev->dev);
@@ -566,9 +567,6 @@ static int nfcwilink_probe(struct platform_device *pdev)
 free_dev_exit:
        nci_free_device(drv->ndev);
 
-free_exit:
-       kfree(drv);
-
 exit:
        return rc;
 }
@@ -588,8 +586,6 @@ static int nfcwilink_remove(struct platform_device *pdev)
        nci_unregister_device(ndev);
        nci_free_device(ndev);
 
-       kfree(drv);
-
        dev_set_drvdata(&pdev->dev, NULL);
 
        return 0;