Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
ethernet: realtek: use module_pci_driver
Browse files Browse the repository at this point in the history
This patch converts to use the macro module_pci_driver, which makes
the code smaller and simpler.

Previously in this driver we are having driver version info will be
printed log buffer based on whether the driver selected as module
or statically into image itself. By using the module_pci_driver that
part of the code removed. For the first time of the device init,
we are making the version info to be printed once.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
bhadram authored and davem330 committed Jul 23, 2014
1 parent 274f482 commit 5490c27
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions drivers/net/ethernet/realtek/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1887,11 +1887,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
resource_size_t pciaddr;
unsigned int addr_len, i, pci_using_dac;

#ifndef MODULE
static int version_printed;
if (version_printed++ == 0)
pr_info("%s", version);
#endif
pr_info_once("%s", version);

if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) {
Expand Down Expand Up @@ -2121,18 +2117,4 @@ static struct pci_driver cp_driver = {
#endif
};

static int __init cp_init (void)
{
#ifdef MODULE
pr_info("%s", version);
#endif
return pci_register_driver(&cp_driver);
}

static void __exit cp_exit (void)
{
pci_unregister_driver (&cp_driver);
}

module_init(cp_init);
module_exit(cp_exit);
module_pci_driver(cp_driver);

0 comments on commit 5490c27

Please sign in to comment.