aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/main.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-08-06 17:03:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 12:43:58 -0400
commitb210d7506f416e7250eb52c314e5ed08928639dd (patch)
treebc5232d3b3b197305a817a65302ba6bad529a322 /drivers/misc/mei/main.c
parent6ddf3aea42ba20eadc8ff362926c947ac43c9401 (diff)
mei: name space for mei device state
1. add MEI_DEV_ prefix for mei device state enums 2. rename mei_state to dev_state 3. add constant to string translation for debug purposes Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r--drivers/misc/mei/main.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index dea65c2c9203..5c557dd129d6 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -232,9 +232,9 @@ static int mei_open(struct inode *inode, struct file *file)
232 goto out_unlock; 232 goto out_unlock;
233 233
234 err = -ENODEV; 234 err = -ENODEV;
235 if (dev->mei_state != MEI_ENABLED) { 235 if (dev->dev_state != MEI_DEV_ENABLED) {
236 dev_dbg(&dev->pdev->dev, "mei_state != MEI_ENABLED mei_state= %d\n", 236 dev_dbg(&dev->pdev->dev, "dev_state != MEI_ENABLED dev_state = %s\n",
237 dev->mei_state); 237 mei_dev_state_str(dev->dev_state));
238 goto out_unlock; 238 goto out_unlock;
239 } 239 }
240 err = -EMFILE; 240 err = -EMFILE;
@@ -384,7 +384,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
384 dev = cl->dev; 384 dev = cl->dev;
385 385
386 mutex_lock(&dev->device_lock); 386 mutex_lock(&dev->device_lock);
387 if (dev->mei_state != MEI_ENABLED) { 387 if (dev->dev_state != MEI_DEV_ENABLED) {
388 rets = -ENODEV; 388 rets = -ENODEV;
389 goto out; 389 goto out;
390 } 390 }
@@ -538,7 +538,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
538 538
539 mutex_lock(&dev->device_lock); 539 mutex_lock(&dev->device_lock);
540 540
541 if (dev->mei_state != MEI_ENABLED) { 541 if (dev->dev_state != MEI_DEV_ENABLED) {
542 mutex_unlock(&dev->device_lock); 542 mutex_unlock(&dev->device_lock);
543 return -ENODEV; 543 return -ENODEV;
544 } 544 }
@@ -613,7 +613,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
613 rets = -ENOMEM; 613 rets = -ENOMEM;
614 goto unlock_dev; 614 goto unlock_dev;
615 } 615 }
616 if (dev->mei_state != MEI_ENABLED) { 616 if (dev->dev_state != MEI_DEV_ENABLED) {
617 rets = -ENODEV; 617 rets = -ENODEV;
618 goto unlock_dev; 618 goto unlock_dev;
619 } 619 }
@@ -769,7 +769,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
769 dev_dbg(&dev->pdev->dev, "IOCTL cmd = 0x%x", cmd); 769 dev_dbg(&dev->pdev->dev, "IOCTL cmd = 0x%x", cmd);
770 770
771 mutex_lock(&dev->device_lock); 771 mutex_lock(&dev->device_lock);
772 if (dev->mei_state != MEI_ENABLED) { 772 if (dev->dev_state != MEI_DEV_ENABLED) {
773 rets = -ENODEV; 773 rets = -ENODEV;
774 goto out; 774 goto out;
775 } 775 }
@@ -848,7 +848,7 @@ static unsigned int mei_poll(struct file *file, poll_table *wait)
848 848
849 mutex_lock(&dev->device_lock); 849 mutex_lock(&dev->device_lock);
850 850
851 if (dev->mei_state != MEI_ENABLED) 851 if (dev->dev_state != MEI_DEV_ENABLED)
852 goto out; 852 goto out;
853 853
854 854
@@ -1118,9 +1118,9 @@ static int mei_pci_suspend(struct device *device)
1118 /* Stop watchdog if exists */ 1118 /* Stop watchdog if exists */
1119 err = mei_wd_stop(dev, true); 1119 err = mei_wd_stop(dev, true);
1120 /* Set new mei state */ 1120 /* Set new mei state */
1121 if (dev->mei_state == MEI_ENABLED || 1121 if (dev->dev_state == MEI_DEV_ENABLED ||
1122 dev->mei_state == MEI_RECOVERING_FROM_RESET) { 1122 dev->dev_state == MEI_DEV_RECOVERING_FROM_RESET) {
1123 dev->mei_state = MEI_POWER_DOWN; 1123 dev->dev_state = MEI_DEV_POWER_DOWN;
1124 mei_reset(dev, 0); 1124 mei_reset(dev, 0);
1125 } 1125 }
1126 mutex_unlock(&dev->device_lock); 1126 mutex_unlock(&dev->device_lock);
@@ -1162,7 +1162,7 @@ static int mei_pci_resume(struct device *device)
1162 } 1162 }
1163 1163
1164 mutex_lock(&dev->device_lock); 1164 mutex_lock(&dev->device_lock);
1165 dev->mei_state = MEI_POWER_UP; 1165 dev->dev_state = MEI_DEV_POWER_UP;
1166 mei_reset(dev, 1); 1166 mei_reset(dev, 1);
1167 mutex_unlock(&dev->device_lock); 1167 mutex_unlock(&dev->device_lock);
1168 1168