Commit 52033415 authored by Brian Norris's avatar Brian Norris Committed by Kalle Valo

mwifiex: pcie: clean up error prints in mwifiex_pcie_reset_notify()

We shouldn't be printing a kernel pointer as a decimal integer. But we
really shouldn't be printing this case at all; we should never get here
with NULL drvdata. We've eliminated this unnecessary conditional in
several other places, so kill it here too.

Similarly, there's no need to check for '!pdev'; we are guaranteed to
have a real device here.

And finally, use dev_err() instead of pr_err().

This yields (for failed PCIe resets):

[   68.286586] mwifiex_pcie 0000:01:00.0: mwifiex_pcie_reset_notify: adapter structure is not valid

instead of:

[   82.932658] mwifiex_pcie: mwifiex_pcie_reset_notify: Card or adapter structure is not valid (-270880688088)
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent ef7e0714
...@@ -350,22 +350,15 @@ MODULE_DEVICE_TABLE(pci, mwifiex_ids); ...@@ -350,22 +350,15 @@ MODULE_DEVICE_TABLE(pci, mwifiex_ids);
static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare) static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
{ {
struct mwifiex_adapter *adapter; struct pcie_service_card *card = pci_get_drvdata(pdev);
struct pcie_service_card *card; struct mwifiex_adapter *adapter = card->adapter;
if (!pdev) {
pr_err("%s: PCIe device is not specified\n", __func__);
return;
}
card = (struct pcie_service_card *)pci_get_drvdata(pdev); if (!adapter) {
if (!card || !card->adapter) { dev_err(&pdev->dev, "%s: adapter structure is not valid\n",
pr_err("%s: Card or adapter structure is not valid (%ld)\n", __func__);
__func__, (long)card);
return; return;
} }
adapter = card->adapter;
mwifiex_dbg(adapter, INFO, mwifiex_dbg(adapter, INFO,
"%s: vendor=0x%4.04x device=0x%4.04x rev=%d %s\n", "%s: vendor=0x%4.04x device=0x%4.04x rev=%d %s\n",
__func__, pdev->vendor, pdev->device, __func__, pdev->vendor, pdev->device,
......
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