Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp400885pxb; Thu, 21 Oct 2021 01:38:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpqbIcUqETXCnqPjYctBEq05BySEdJZYu/Zb+A4WwFQY+DQe7ZaokPGPvy26B+59mefBqP X-Received: by 2002:a17:90a:4fc5:: with SMTP id q63mr5195887pjh.148.1634805528043; Thu, 21 Oct 2021 01:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634805528; cv=none; d=google.com; s=arc-20160816; b=GR5HPEjjbRG/5AW8u5aXx7vASHRmbk+LL9xmLNF4LfutawpxMhV/hDUCOxyk6vS5KN GksQxxlqJfNlzz6afX5woE5/2LWWMmgeI1U2PmIbZj0LnmigAk0aJGQGsvhaEASgc8Wl oMesszmw+bwNx1mc+SSWR5irK3f6nBnw/tWRtpUEt+uxcaCmPaAsP2/mLeo08xMo7rwU w5quMbhd0AqkHlE99kzese1vftJ/Lz5fwgVt5mSfWJ9+yPiAVHc/BQ4Fwzsalh/0AMpF es5+m18e6upWBQaLT9DqYYwIHDqkfugdYwBCPqvoq5D0/OGD4OTLL5EEGQDTt8aCnyso NL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-filter; bh=oRVaHqqz9UVpt2sNd8mU9BvpOuPNTBTqNTtfuy0uqNY=; b=gbTAAPIMgsguMzIyxY7XSTggkTUwQx8G9FQjBqTrrslQtP+ZxFpR4nteMcxxXbGVwa 8MKopfO48BoaHGMq4ebaHTfaMYkJ2Xm+Q4jW5pwwsmGImhmXY4gGQo4wycdosFXuWbg1 QIkgqLlmSVMtPk8UznetrAeqe8QTyB7/X2cK7FIw5AtPdFBj3E7tIxX/xAMVqa9F8vJI lUlWLhXIcBoxGSiA+4Rq6/Sew4lbZ33yKlj76uMl88nA6IMxvWwzZmtXZKCT9Fupn1a8 bFYFDl7AAX+zZe0E6iS+APDwc/XoKp/IBNEOcyNZhzNpXfo+nI/dQneNvwEAG7HkAWl2 li2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si5855626pjp.159.2021.10.21.01.38.34; Thu, 21 Oct 2021 01:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbhJUIjm (ORCPT + 99 others); Thu, 21 Oct 2021 04:39:42 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:59130 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbhJUIjj (ORCPT ); Thu, 21 Oct 2021 04:39:39 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 2B0FB20CB033 Received: from LanCloud Received: from LanCloud Received: from LanCloud Message-ID: Date: Thu, 21 Oct 2021 11:37:09 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] ata: sata_mv: Fix the return value of the probe function Content-Language: en-US To: Zheyu Ma , CC: , References: <1634795836-1803-1-git-send-email-zheyuma97@gmail.com> From: Sergey Shtylyov Organization: Open Mobile Platform In-Reply-To: <1634795836-1803-1-git-send-email-zheyuma97@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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