mei: rename struct pci_dev *mei_device to mei_pdev

1. rename mei_device variable to mei_pdev to remove
confusion with type 'struct mei_device'
2. mei_pdev no longer need to be gloabal so make it static
 and remove the declaration from the header file

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler 2012-08-17 09:54:23 +03:00 committed by Greg Kroah-Hartman
parent efda0ad4aa
commit daed6b5e78
2 changed files with 8 additions and 14 deletions

View File

@ -41,9 +41,8 @@
#include <linux/mei.h> #include <linux/mei.h>
#include "interface.h" #include "interface.h"
/* The device pointer */ /* AMT device is a singleton on the platform */
/* Currently this driver works as long as there is only a single AMT device. */ static struct pci_dev *mei_pdev;
struct pci_dev *mei_device;
/* mei_pci_tbl - PCI Device ID Table */ /* mei_pci_tbl - PCI Device ID Table */
static DEFINE_PCI_DEVICE_TABLE(mei_pci_tbl) = { static DEFINE_PCI_DEVICE_TABLE(mei_pci_tbl) = {
@ -218,10 +217,10 @@ static int mei_open(struct inode *inode, struct file *file)
int err; int err;
err = -ENODEV; err = -ENODEV;
if (!mei_device) if (!mei_pdev)
goto out; goto out;
dev = pci_get_drvdata(mei_device); dev = pci_get_drvdata(mei_pdev);
if (!dev) if (!dev)
goto out; goto out;
@ -945,7 +944,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
goto end; goto end;
} }
if (mei_device) { if (mei_pdev) {
err = -EEXIST; err = -EEXIST;
goto end; goto end;
} }
@ -1006,7 +1005,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
if (err) if (err)
goto release_irq; goto release_irq;
mei_device = pdev; mei_pdev = pdev;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
@ -1051,7 +1050,7 @@ static void __devexit mei_remove(struct pci_dev *pdev)
{ {
struct mei_device *dev; struct mei_device *dev;
if (mei_device != pdev) if (mei_pdev != pdev)
return; return;
dev = pci_get_drvdata(pdev); dev = pci_get_drvdata(pdev);
@ -1064,7 +1063,7 @@ static void __devexit mei_remove(struct pci_dev *pdev)
mei_wd_stop(dev); mei_wd_stop(dev);
mei_device = NULL; mei_pdev = NULL;
if (dev->iamthif_cl.state == MEI_FILE_CONNECTED) { if (dev->iamthif_cl.state == MEI_FILE_CONNECTED) {
dev->iamthif_cl.state = MEI_FILE_DISCONNECTING; dev->iamthif_cl.state = MEI_FILE_DISCONNECTING;

View File

@ -39,11 +39,6 @@
#define MEI_RD_MSG_BUF_SIZE (128 * sizeof(u32)) #define MEI_RD_MSG_BUF_SIZE (128 * sizeof(u32))
/*
* MEI PCI Device object
*/
extern struct pci_dev *mei_device;
/* /*
* AMTHI Client UUID * AMTHI Client UUID