public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Zheyu Ma <zheyuma97@gmail.com>, <damien.lemoal@opensource.wdc.com>
Cc: <linux-ide@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ata: sata_mv: Fix the return value of the probe function
Date: Thu, 21 Oct 2021 11:37:09 +0300	[thread overview]
Message-ID: <e1f96f77-cf44-7783-bf88-0814bbabbfbc@omp.ru> (raw)
In-Reply-To: <1634795836-1803-1-git-send-email-zheyuma97@gmail.com>

On 21.10.2021 8:57, Zheyu Ma wrote:

> mv_init_host() propagates the value returned by mv_chip_id() which in turn
> gets propagated by mv_pci_init_one() and hits local_pci_probe().
> 
> During the process of driver probing, the probe function should return < 0
> for failure, otherwise, the kernel will treat value > 0 as success.
> 
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
>   drivers/ata/sata_mv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index 9d86203e1e7a..7461fe078dd1 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -3897,7 +3897,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
>   
>   	default:
>   		dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
> -		return 1;
> +		return -ENODEV;

    Doesn't -EINVAL fit better here?

[...]

MBR, Sergey

  reply	other threads:[~2021-10-21  8:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  5:57 [PATCH] ata: sata_mv: Fix the return value of the probe function Zheyu Ma
2021-10-21  8:37 ` Sergey Shtylyov [this message]
2021-10-21 10:38   ` Damien Le Moal
2021-10-21 11:23     ` Zheyu Ma
2021-10-22  1:40       ` Damien Le Moal
2021-10-22  1:41       ` Damien Le Moal
2021-10-22  9:18         ` Zheyu Ma

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=e1f96f77-cf44-7783-bf88-0814bbabbfbc@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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