staging: kpc2000: remove kp200_module.c file
The kp200_module.c does not need to be stand-alone, so move it into the core.c file. This lets us make some functions static, reducing the global namespace of the driver. Cc: Matt Sickler <Matt.Sickler@daktronics.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
59ae81e11f
commit
92642f385b
|
@ -1,4 +1,4 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
obj-m := kpc2000.o
|
||||
kpc2000-objs += kp2000_module.o core.o cell_probe.o fileops.o
|
||||
kpc2000-objs += core.o cell_probe.o fileops.o
|
||||
|
|
|
@ -198,7 +198,8 @@ irqreturn_t kp2000_irq_handler(int irq, void *dev_id)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
int kp2000_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
static int kp2000_pcie_probe(struct pci_dev *pdev,
|
||||
const struct pci_device_id *id)
|
||||
{
|
||||
int err = 0;
|
||||
struct kp2000_device *pcard;
|
||||
|
@ -405,7 +406,7 @@ int kp2000_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
}
|
||||
|
||||
|
||||
void kp2000_pcie_remove(struct pci_dev *pdev)
|
||||
static void kp2000_pcie_remove(struct pci_dev *pdev)
|
||||
{
|
||||
struct kp2000_device *pcard = pci_get_drvdata(pdev);
|
||||
|
||||
|
@ -435,3 +436,42 @@ void kp2000_pcie_remove(struct pci_dev *pdev)
|
|||
unlock_card(pcard);
|
||||
kfree(pcard);
|
||||
}
|
||||
|
||||
struct class *kpc_uio_class;
|
||||
ATTRIBUTE_GROUPS(kpc_uio_class);
|
||||
|
||||
static const struct pci_device_id kp2000_pci_device_ids[] = {
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_DAKTRONICS, PCI_DEVICE_ID_DAKTRONICS) },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_DAKTRONICS, PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0) },
|
||||
{ 0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, kp2000_pci_device_ids);
|
||||
|
||||
static struct pci_driver kp2000_driver_inst = {
|
||||
.name = "kp2000_pcie",
|
||||
.id_table = kp2000_pci_device_ids,
|
||||
.probe = kp2000_pcie_probe,
|
||||
.remove = kp2000_pcie_remove,
|
||||
};
|
||||
|
||||
static int __init kp2000_pcie_init(void)
|
||||
{
|
||||
kpc_uio_class = class_create(THIS_MODULE, "kpc_uio");
|
||||
if (IS_ERR(kpc_uio_class))
|
||||
return PTR_ERR(kpc_uio_class);
|
||||
|
||||
kpc_uio_class->dev_groups = kpc_uio_class_groups;
|
||||
return pci_register_driver(&kp2000_driver_inst);
|
||||
}
|
||||
module_init(kp2000_pcie_init);
|
||||
|
||||
static void __exit kp2000_pcie_exit(void)
|
||||
{
|
||||
pci_unregister_driver(&kp2000_driver_inst);
|
||||
class_destroy(kpc_uio_class);
|
||||
}
|
||||
module_exit(kp2000_pcie_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Lee.Brooke@Daktronics.com, Matt.Sickler@Daktronics.com");
|
||||
MODULE_SOFTDEP("pre: uio post: kpc_nwl_dma kpc_i2c kpc_spi");
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mfd/core.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ioport.h>
|
||||
#include "pcie.h"
|
||||
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Lee.Brooke@Daktronics.com, Matt.Sickler@Daktronics.com");
|
||||
MODULE_SOFTDEP("pre: uio post: kpc_nwl_dma kpc_i2c kpc_spi");
|
||||
|
||||
struct class *kpc_uio_class;
|
||||
ATTRIBUTE_GROUPS(kpc_uio_class);
|
||||
|
||||
static const struct pci_device_id kp2000_pci_device_ids[] = {
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_DAKTRONICS, PCI_DEVICE_ID_DAKTRONICS) },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_DAKTRONICS, PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0) },
|
||||
{ 0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, kp2000_pci_device_ids);
|
||||
|
||||
static struct pci_driver kp2000_driver_inst = {
|
||||
.name = "kp2000_pcie",
|
||||
.id_table = kp2000_pci_device_ids,
|
||||
.probe = kp2000_pcie_probe,
|
||||
.remove = kp2000_pcie_remove
|
||||
};
|
||||
|
||||
|
||||
static int __init kp2000_pcie_init(void)
|
||||
{
|
||||
kpc_uio_class = class_create(THIS_MODULE, "kpc_uio");
|
||||
if (IS_ERR(kpc_uio_class))
|
||||
return PTR_ERR(kpc_uio_class);
|
||||
|
||||
kpc_uio_class->dev_groups = kpc_uio_class_groups;
|
||||
return pci_register_driver(&kp2000_driver_inst);
|
||||
}
|
||||
module_init(kp2000_pcie_init);
|
||||
|
||||
static void __exit kp2000_pcie_exit(void)
|
||||
{
|
||||
pci_unregister_driver(&kp2000_driver_inst);
|
||||
class_destroy(kpc_uio_class);
|
||||
}
|
||||
module_exit(kp2000_pcie_exit);
|
|
@ -84,8 +84,6 @@ struct kp2000_device {
|
|||
extern struct class *kpc_uio_class;
|
||||
extern struct attribute *kpc_uio_class_attrs[];
|
||||
|
||||
int kp2000_pcie_probe(struct pci_dev *dev, const struct pci_device_id *id);
|
||||
void kp2000_pcie_remove(struct pci_dev *pdev);
|
||||
int kp2000_probe_cores(struct kp2000_device *pcard);
|
||||
void kp2000_remove_cores(struct kp2000_device *pcard);
|
||||
|
||||
|
|
Loading…
Reference in New Issue