Skip to content

Commit

Permalink
Staging: intel_sst: Use pr_fmt, fix misspellings
Browse files Browse the repository at this point in the history
Remove leading "sst: " from format strings.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Prefix is changed from "sst: " to "snd_intel_sst: "
Add missing newlines
Trim trailing spaces after newlines
Fix several different misspellings

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Nov 9, 2010
1 parent 2ff8111 commit d0f40c5
Show file tree
Hide file tree
Showing 15 changed files with 566 additions and 533 deletions.
50 changes: 26 additions & 24 deletions drivers/staging/intel_sst/intel_sst.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* This file contains all init functions
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/pci.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -169,17 +171,17 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
{
int i, ret = 0;

pr_debug("sst: Probe for DID %x\n", pci->device);
pr_debug("Probe for DID %x\n", pci->device);
mutex_lock(&drv_ctx_lock);
if (sst_drv_ctx) {
pr_err("sst: Only one sst handle is supported\n");
pr_err("Only one sst handle is supported\n");
mutex_unlock(&drv_ctx_lock);
return -EBUSY;
}

sst_drv_ctx = kzalloc(sizeof(*sst_drv_ctx), GFP_KERNEL);
if (!sst_drv_ctx) {
pr_err("sst: intel_sst malloc fail\n");
pr_err("malloc fail\n");
mutex_unlock(&drv_ctx_lock);
return -ENOMEM;
}
Expand Down Expand Up @@ -226,7 +228,7 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
spin_lock_init(&sst_drv_ctx->list_spin_lock);

sst_drv_ctx->max_streams = pci_id->driver_data;
pr_debug("sst: Got drv data max stream %d\n",
pr_debug("Got drv data max stream %d\n",
sst_drv_ctx->max_streams);
for (i = 1; i <= sst_drv_ctx->max_streams; i++) {
struct stream_info *stream = &sst_drv_ctx->streams[i];
Expand All @@ -241,26 +243,26 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
sst_drv_ctx->mmap_mem =
kzalloc(sst_drv_ctx->mmap_len, GFP_KERNEL);
if (sst_drv_ctx->mmap_mem) {
pr_debug("sst: Got memory %p size 0x%x\n",
pr_debug("Got memory %p size 0x%x\n",
sst_drv_ctx->mmap_mem,
sst_drv_ctx->mmap_len);
break;
}
if (sst_drv_ctx->mmap_len < (SST_MMAP_STEP*PAGE_SIZE)) {
pr_err("sst: mem alloc fail...abort!!\n");
pr_err("mem alloc fail...abort!!\n");
ret = -ENOMEM;
goto free_process_reply_wq;
}
sst_drv_ctx->mmap_len -= (SST_MMAP_STEP * PAGE_SIZE);
pr_debug("sst:mem alloc failed...trying %d\n",
pr_debug("mem alloc failed...trying %d\n",
sst_drv_ctx->mmap_len);
}
}

/* Init the device */
ret = pci_enable_device(pci);
if (ret) {
pr_err("sst: device cant be enabled\n");
pr_err("device cant be enabled\n");
goto do_free_mem;
}
sst_drv_ctx->pci = pci_dev_get(pci);
Expand All @@ -273,25 +275,25 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
sst_drv_ctx->shim = pci_ioremap_bar(pci, 1);
if (!sst_drv_ctx->shim)
goto do_release_regions;
pr_debug("sst: SST Shim Ptr %p\n", sst_drv_ctx->shim);
pr_debug("SST Shim Ptr %p\n", sst_drv_ctx->shim);

/* Shared SRAM */
sst_drv_ctx->mailbox = pci_ioremap_bar(pci, 2);
if (!sst_drv_ctx->mailbox)
goto do_unmap_shim;
pr_debug("sst: SRAM Ptr %p\n", sst_drv_ctx->mailbox);
pr_debug("SRAM Ptr %p\n", sst_drv_ctx->mailbox);

/* IRAM */
sst_drv_ctx->iram = pci_ioremap_bar(pci, 3);
if (!sst_drv_ctx->iram)
goto do_unmap_sram;
pr_debug("sst:IRAM Ptr %p\n", sst_drv_ctx->iram);
pr_debug("IRAM Ptr %p\n", sst_drv_ctx->iram);

/* DRAM */
sst_drv_ctx->dram = pci_ioremap_bar(pci, 4);
if (!sst_drv_ctx->dram)
goto do_unmap_iram;
pr_debug("sst: DRAM Ptr %p\n", sst_drv_ctx->dram);
pr_debug("DRAM Ptr %p\n", sst_drv_ctx->dram);

mutex_lock(&sst_drv_ctx->sst_lock);
sst_drv_ctx->sst_state = SST_UN_INIT;
Expand All @@ -301,24 +303,24 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
IRQF_SHARED, SST_DRV_NAME, sst_drv_ctx);
if (ret)
goto do_unmap_dram;
pr_debug("sst: Registered IRQ 0x%x\n", pci->irq);
pr_debug("Registered IRQ 0x%x\n", pci->irq);

if (sst_drv_ctx->pci_id == SST_MRST_PCI_ID) {
ret = misc_register(&lpe_dev);
if (ret) {
pr_err("sst: couldn't register LPE device\n");
pr_err("couldn't register LPE device\n");
goto do_free_irq;
}

/*Register LPE Control as misc driver*/
ret = misc_register(&lpe_ctrl);
if (ret) {
pr_err("sst: couldn't register misc driver\n");
pr_err("couldn't register misc driver\n");
goto do_free_irq;
}
}
sst_drv_ctx->lpe_stalled = 0;
pr_debug("sst: ...successfully done!!!\n");
pr_debug("...successfully done!!!\n");
return ret;

do_free_irq:
Expand Down Expand Up @@ -347,7 +349,7 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
destroy_workqueue(sst_drv_ctx->mad_wq);
do_free_drv_ctx:
kfree(sst_drv_ctx);
pr_err("sst: Probe failed with 0x%x\n", ret);
pr_err("Probe failed with 0x%x\n", ret);
return ret;
}

Expand Down Expand Up @@ -404,7 +406,7 @@ int intel_sst_suspend(struct pci_dev *pci, pm_message_t state)
{
union config_status_reg csr;

pr_debug("sst: intel_sst_suspend called\n");
pr_debug("intel_sst_suspend called\n");

if (sst_drv_ctx->pb_streams != 0 || sst_drv_ctx->cp_streams != 0)
return -EPERM;
Expand Down Expand Up @@ -434,17 +436,17 @@ int intel_sst_resume(struct pci_dev *pci)
{
int ret = 0;

pr_debug("sst: intel_sst_resume called\n");
pr_debug("intel_sst_resume called\n");
if (sst_drv_ctx->sst_state != SST_SUSPENDED) {
pr_err("sst: SST is not in suspended state\n");
pr_err("SST is not in suspended state\n");
return -EPERM;
}
sst_drv_ctx = pci_get_drvdata(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
ret = pci_enable_device(pci);
if (ret)
pr_err("sst: device cant be enabled\n");
pr_err("device cant be enabled\n");

mutex_lock(&sst_drv_ctx->sst_lock);
sst_drv_ctx->sst_state = SST_UN_INIT;
Expand Down Expand Up @@ -482,14 +484,14 @@ static int __init intel_sst_init(void)
{
/* Init all variables, data structure etc....*/
int ret = 0;
pr_debug("sst: INFO: ******** SST DRIVER loading.. Ver: %s\n",
pr_debug("INFO: ******** SST DRIVER loading.. Ver: %s\n",
SST_DRIVER_VERSION);

mutex_init(&drv_ctx_lock);
/* Register with PCI */
ret = pci_register_driver(&driver);
if (ret)
pr_err("sst: PCI register failed\n");
pr_err("PCI register failed\n");
return ret;
}

Expand All @@ -504,7 +506,7 @@ static void __exit intel_sst_exit(void)
{
pci_unregister_driver(&driver);

pr_debug("sst: driver unloaded\n");
pr_debug("driver unloaded\n");
return;
}

Expand Down
Loading

0 comments on commit d0f40c5

Please sign in to comment.