From: Denis Kirjanov <dkirjanov@suse.de>
To: Zheyu Ma <zheyuma97@gmail.com>, isdn@linux-pingi.de, davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mISDN: Fix return values of the probe function
Date: Mon, 18 Oct 2021 20:06:51 +0300 [thread overview]
Message-ID: <02fe8f6c-e332-5286-a759-750f47c3512a@suse.de> (raw)
In-Reply-To: <1634566838-3804-1-git-send-email-zheyuma97@gmail.com>
10/18/21 5:20 PM, Zheyu Ma пишет:
> During the process of driver probing, the probe function should return < 0
> for failure, otherwise, the kernel will treat value > 0 as success.
setup_card() checks for the return value.
Thus it makes sense to submit the patch with net-next tag
>
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
> drivers/isdn/hardware/mISDN/hfcpci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
> index e501cb03f211..bd087cca1c1d 100644
> --- a/drivers/isdn/hardware/mISDN/hfcpci.c
> +++ b/drivers/isdn/hardware/mISDN/hfcpci.c
> @@ -1994,14 +1994,14 @@ setup_hw(struct hfc_pci *hc)
> pci_set_master(hc->pdev);
> if (!hc->irq) {
> printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
> - return 1;
> + return -EINVAL;
> }
> hc->hw.pci_io =
> (char __iomem *)(unsigned long)hc->pdev->resource[1].start;
>
> if (!hc->hw.pci_io) {
> printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
> - return 1;
> + return -ENOMEM;
> }
> /* Allocate memory for FIFOS */
> /* the memory needs to be on a 32k boundary within the first 4G */
> @@ -2012,7 +2012,7 @@ setup_hw(struct hfc_pci *hc)
> if (!buffer) {
> printk(KERN_WARNING
> "HFC-PCI: Error allocating memory for FIFO!\n");
> - return 1;
> + return -ENOMEM;
> }
> hc->hw.fifos = buffer;
> pci_write_config_dword(hc->pdev, 0x80, hc->hw.dmahandle);
> @@ -2022,7 +2022,7 @@ setup_hw(struct hfc_pci *hc)
> "HFC-PCI: Error in ioremap for PCI!\n");
> dma_free_coherent(&hc->pdev->dev, 0x8000, hc->hw.fifos,
> hc->hw.dmahandle);
> - return 1;
> + return -ENOMEM;
> }
>
> printk(KERN_INFO
>
next prev parent reply other threads:[~2021-10-18 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 14:20 Zheyu Ma
2021-10-18 17:06 ` Denis Kirjanov [this message]
2021-10-18 23:15 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02fe8f6c-e332-5286-a759-750f47c3512a@suse.de \
--to=dkirjanov@suse.de \
--cc=davem@davemloft.net \
--cc=isdn@linux-pingi.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=zheyuma97@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®