summaryrefslogtreecommitdiff
path: root/drivers/uio/uio_aec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uio/uio_aec.c')
-rw-r--r--drivers/uio/uio_aec.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/uio/uio_aec.c b/drivers/uio/uio_aec.c
index 1549fab633c6..dafcc5f44f24 100644
--- a/drivers/uio/uio_aec.c
+++ b/drivers/uio/uio_aec.c
@@ -1,20 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* uio_aec.c -- simple driver for Adrienne Electronics Corp time code PCI device
*
* Copyright (C) 2008 Brandon Philips <brandon@ifup.org>
- *
- * 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.
*/
#include <linux/kernel.h>
@@ -45,7 +33,7 @@
#define MAILBOX 0x0F
-static struct pci_device_id ids[] = {
+static const struct pci_device_id ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AEC, PCI_DEVICE_ID_AEC_VITCLTC), },
{ 0, }
};
@@ -83,12 +71,12 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
struct uio_info *info;
int ret;
- info = kzalloc(sizeof(struct uio_info), GFP_KERNEL);
+ info = devm_kzalloc(&pdev->dev, sizeof(struct uio_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
if (pci_enable_device(pdev))
- goto out_free;
+ return -ENODEV;
if (pci_request_regions(pdev, "aectc"))
goto out_disable;
@@ -129,8 +117,6 @@ out_release:
pci_release_regions(pdev);
out_disable:
pci_disable_device(pdev);
-out_free:
- kfree(info);
return -ENODEV;
}
@@ -147,9 +133,7 @@ static void remove(struct pci_dev *pdev)
uio_unregister_device(info);
pci_release_regions(pdev);
pci_disable_device(pdev);
- iounmap(info->priv);
-
- kfree(info);
+ pci_iounmap(pdev, info->priv);
}
static struct pci_driver pci_driver = {
@@ -160,4 +144,5 @@ static struct pci_driver pci_driver = {
};
module_pci_driver(pci_driver);
+MODULE_DESCRIPTION("Adrienne Electronics Corp time code PCI device");
MODULE_LICENSE("GPL");