Commit 19185703 authored by Miguel Gómez's avatar Miguel Gómez Committed by Greg Kroah-Hartman

Staging: xgifb: Replace pr_* with dev_* when possible.

Replace pr_* calls with dev_* ones when the device structure is available.
Signed-off-by: default avatarMiguel Gómez <magomez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e054102b
...@@ -1838,7 +1838,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1838,7 +1838,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
xgifb_info->mmio_base = pci_resource_start(pdev, 1); xgifb_info->mmio_base = pci_resource_start(pdev, 1);
xgifb_info->mmio_size = pci_resource_len(pdev, 1); xgifb_info->mmio_size = pci_resource_len(pdev, 1);
xgifb_info->vga_base = pci_resource_start(pdev, 2) + 0x30; xgifb_info->vga_base = pci_resource_start(pdev, 2) + 0x30;
pr_info("Relocate IO address: %Lx [%08lx]\n", dev_info(&pdev->dev, "Relocate IO address: %Lx [%08lx]\n",
(u64) pci_resource_start(pdev, 2), (u64) pci_resource_start(pdev, 2),
xgifb_info->vga_base); xgifb_info->vga_base);
...@@ -1858,7 +1858,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1858,7 +1858,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
reg1 = xgifb_reg_get(XGISR, IND_SIS_PASSWORD); reg1 = xgifb_reg_get(XGISR, IND_SIS_PASSWORD);
if (reg1 != 0xa1) { /*I/O error */ if (reg1 != 0xa1) { /*I/O error */
pr_err("I/O error!!!"); dev_err(&pdev->dev, "I/O error!!!");
ret = -EIO; ret = -EIO;
goto error_disable; goto error_disable;
} }
...@@ -1886,11 +1886,12 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1886,11 +1886,12 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
goto error_disable; goto error_disable;
} }
pr_info("chipid = %x\n", xgifb_info->chip); dev_info(&pdev->dev, "chipid = %x\n", xgifb_info->chip);
hw_info->jChipType = xgifb_info->chip; hw_info->jChipType = xgifb_info->chip;
if (XGIfb_get_dram_size(xgifb_info)) { if (XGIfb_get_dram_size(xgifb_info)) {
pr_err("Fatal error: Unable to determine RAM size.\n"); dev_err(&pdev->dev,
"Fatal error: Unable to determine RAM size.\n");
ret = -ENODEV; ret = -ENODEV;
goto error_disable; goto error_disable;
} }
...@@ -1907,10 +1908,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1907,10 +1908,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (!request_mem_region(xgifb_info->video_base, if (!request_mem_region(xgifb_info->video_base,
xgifb_info->video_size, xgifb_info->video_size,
"XGIfb FB")) { "XGIfb FB")) {
pr_err("unable request memory size %x\n", dev_err(&pdev->dev, "unable request memory size %x\n",
xgifb_info->video_size); xgifb_info->video_size);
pr_err("Fatal error: Unable to reserve frame buffer memory\n"); dev_err(&pdev->dev,
pr_err("Is there another framebuffer driver active?\n"); "Fatal error: Unable to reserve frame buffer memory. "
"Is there another framebuffer driver active?\n");
ret = -ENODEV; ret = -ENODEV;
goto error_disable; goto error_disable;
} }
...@@ -1918,7 +1920,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1918,7 +1920,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (!request_mem_region(xgifb_info->mmio_base, if (!request_mem_region(xgifb_info->mmio_base,
xgifb_info->mmio_size, xgifb_info->mmio_size,
"XGIfb MMIO")) { "XGIfb MMIO")) {
pr_err("Fatal error: Unable to reserve MMIO region\n"); dev_err(&pdev->dev,
"Fatal error: Unable to reserve MMIO region\n");
ret = -ENODEV; ret = -ENODEV;
goto error_0; goto error_0;
} }
...@@ -1928,18 +1931,20 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1928,18 +1931,20 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
xgifb_info->mmio_vbase = ioremap(xgifb_info->mmio_base, xgifb_info->mmio_vbase = ioremap(xgifb_info->mmio_base,
xgifb_info->mmio_size); xgifb_info->mmio_size);
pr_info("Framebuffer at 0x%Lx, mapped to 0x%p, size %dk\n", dev_info(&pdev->dev,
"Framebuffer at 0x%Lx, mapped to 0x%p, size %dk\n",
(u64) xgifb_info->video_base, (u64) xgifb_info->video_base,
xgifb_info->video_vbase, xgifb_info->video_vbase,
xgifb_info->video_size / 1024); xgifb_info->video_size / 1024);
pr_info("MMIO at 0x%Lx, mapped to 0x%p, size %ldk\n", dev_info(&pdev->dev,
"MMIO at 0x%Lx, mapped to 0x%p, size %ldk\n",
(u64) xgifb_info->mmio_base, xgifb_info->mmio_vbase, (u64) xgifb_info->mmio_base, xgifb_info->mmio_vbase,
xgifb_info->mmio_size / 1024); xgifb_info->mmio_size / 1024);
pci_set_drvdata(pdev, xgifb_info); pci_set_drvdata(pdev, xgifb_info);
if (!XGIInitNew(pdev)) if (!XGIInitNew(pdev))
pr_err("XGIInitNew() failed!\n"); dev_err(&pdev->dev, "XGIInitNew() failed!\n");
xgifb_info->mtrr = (unsigned int) 0; xgifb_info->mtrr = (unsigned int) 0;
...@@ -1968,10 +1973,14 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1968,10 +1973,14 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
reg = xgifb_reg_get(XGIPART4, 0x01); reg = xgifb_reg_get(XGIPART4, 0x01);
if (reg >= 0xE0) { if (reg >= 0xE0) {
hw_info->ujVBChipID = VB_CHIP_302LV; hw_info->ujVBChipID = VB_CHIP_302LV;
pr_info("XGI302LV bridge detected (revision 0x%02x)\n", reg); dev_info(&pdev->dev,
"XGI302LV bridge detected (revision 0x%02x)\n",
reg);
} else if (reg >= 0xD0) { } else if (reg >= 0xD0) {
hw_info->ujVBChipID = VB_CHIP_301LV; hw_info->ujVBChipID = VB_CHIP_301LV;
pr_info("XGI301LV bridge detected (revision 0x%02x)\n", reg); dev_info(&pdev->dev,
"XGI301LV bridge detected (revision 0x%02x)\n",
reg);
} }
/* else if (reg >= 0xB0) { /* else if (reg >= 0xB0) {
hw_info->ujVBChipID = VB_CHIP_301B; hw_info->ujVBChipID = VB_CHIP_301B;
...@@ -1980,17 +1989,21 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1980,17 +1989,21 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
} */ } */
else { else {
hw_info->ujVBChipID = VB_CHIP_301; hw_info->ujVBChipID = VB_CHIP_301;
pr_info("XGI301 bridge detected\n"); dev_info(&pdev->dev, "XGI301 bridge detected\n");
} }
break; break;
case HASVB_302: case HASVB_302:
reg = xgifb_reg_get(XGIPART4, 0x01); reg = xgifb_reg_get(XGIPART4, 0x01);
if (reg >= 0xE0) { if (reg >= 0xE0) {
hw_info->ujVBChipID = VB_CHIP_302LV; hw_info->ujVBChipID = VB_CHIP_302LV;
pr_info("XGI302LV bridge detected (revision 0x%02x)\n", reg); dev_info(&pdev->dev,
"XGI302LV bridge detected (revision 0x%02x)\n",
reg);
} else if (reg >= 0xD0) { } else if (reg >= 0xD0) {
hw_info->ujVBChipID = VB_CHIP_301LV; hw_info->ujVBChipID = VB_CHIP_301LV;
pr_info("XGI302LV bridge detected (revision 0x%02x)\n", reg); dev_info(&pdev->dev,
"XGI302LV bridge detected (revision 0x%02x)\n",
reg);
} else if (reg >= 0xB0) { } else if (reg >= 0xB0) {
reg1 = xgifb_reg_get(XGIPART4, 0x23); reg1 = xgifb_reg_get(XGIPART4, 0x23);
...@@ -1998,27 +2011,28 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -1998,27 +2011,28 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
} else { } else {
hw_info->ujVBChipID = VB_CHIP_302; hw_info->ujVBChipID = VB_CHIP_302;
pr_info("XGI302 bridge detected\n"); dev_info(&pdev->dev, "XGI302 bridge detected\n");
} }
break; break;
case HASVB_LVDS: case HASVB_LVDS:
hw_info->ulExternalChip = 0x1; hw_info->ulExternalChip = 0x1;
pr_info("LVDS transmitter detected\n"); dev_info(&pdev->dev, "LVDS transmitter detected\n");
break; break;
case HASVB_TRUMPION: case HASVB_TRUMPION:
hw_info->ulExternalChip = 0x2; hw_info->ulExternalChip = 0x2;
pr_info("Trumpion Zurac LVDS scaler detected\n"); dev_info(&pdev->dev, "Trumpion Zurac LVDS scaler detected\n");
break; break;
case HASVB_CHRONTEL: case HASVB_CHRONTEL:
hw_info->ulExternalChip = 0x4; hw_info->ulExternalChip = 0x4;
pr_info("Chrontel TV encoder detected\n"); dev_info(&pdev->dev, "Chrontel TV encoder detected\n");
break; break;
case HASVB_LVDS_CHRONTEL: case HASVB_LVDS_CHRONTEL:
hw_info->ulExternalChip = 0x5; hw_info->ulExternalChip = 0x5;
pr_info("LVDS transmitter and Chrontel TV encoder detected\n"); dev_info(&pdev->dev,
"LVDS transmitter and Chrontel TV encoder detected\n");
break; break;
default: default:
pr_info("No or unknown bridge type detected\n"); dev_info(&pdev->dev, "No or unknown bridge type detected\n");
break; break;
} }
......
...@@ -1319,11 +1319,11 @@ unsigned char XGIInitNew(struct pci_dev *pdev) ...@@ -1319,11 +1319,11 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
/* Newdebugcode(0x99); */ /* Newdebugcode(0x99); */
if (pVBInfo->FBAddr == NULL) { if (pVBInfo->FBAddr == NULL) {
pr_debug("pVBInfo->FBAddr == 0\n"); dev_dbg(&pdev->dev, "pVBInfo->FBAddr == 0\n");
return 0; return 0;
} }
if (pVBInfo->BaseAddr == 0) { if (pVBInfo->BaseAddr == 0) {
pr_debug("pVBInfo->BaseAddr == 0\n"); dev_dbg(&pdev->dev, "pVBInfo->BaseAddr == 0\n");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment