Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2172049rdb; Mon, 9 Oct 2023 15:34:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFupGxhyDEWw8HIuRvNEoO4U4b0RBNTwmIFHFLhh8NpT1Uj9IkQCeexP/UJd6zRsY66ylJp X-Received: by 2002:aca:2808:0:b0:3a3:9df9:1918 with SMTP id 8-20020aca2808000000b003a39df91918mr14331031oix.20.1696890846610; Mon, 09 Oct 2023 15:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696890846; cv=none; d=google.com; s=arc-20160816; b=z1CxOz4CigTL55zJagmrpSI6FurnWQrZpx2uFvINn5+LwG7eD4kyxZVqYzn/1/EIc4 OZ8AAgC1fqYFddiYIZ15Y8pdOXETh9pxWY1IXJ7EVXpYu06Ktu9AAhIYz0ZHBxJbQs9q c/awVS+DU4XYjTLiFjZQcGHzf4JzCCuHS84xYR0ps9f9LuadmKeeDPr72HzAXONExGQZ ELwR5ycQwhapmD1GESJ6cRh1VlmjgG3fCrSuBLvAvYVCgzWZuD1lt82wKW4kbfNsXSvM 1tsrqZePDLt0HSIVn6TSFzP3bu/dJHj3pajzntRJBKQ2j/PfTg0PhIEki7Q6jWHlx+MR wTeg== 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:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=hV/5jgL/1SghBvVAvmSClxxECrE4QcveAYAFeEEKeWc=; fh=Zi+DalhA95FJDS2mtczO5C+F+mJmPuIkOUStYBT/adY=; b=zvvkiSxY4743T0j90aA/mn1Ju3jVDcuoc8JQEx9gntdCHMwI9SXDOX14RCEZVh275E HTt+6yJq5619D//8C/QBP/0pxBENDLGqJlMOOnpa73evD1MC8iB7qjYtt9AiG3UpnZft beUfzTUrSNrVGNFDosRh4T4g7cEVpuBLe4Qbu+enysEbMhVmJ8GDPjtNAg3qeUqJFAUB DFfRP6EAtCFJ6qLmu7ZHS1aFgO3iWmE8BkdvSiJxehury8VgKg3fDlDPqWHuChdI4onM A3nJ8cljozkFJ6ZBK1EUXIlmGbSOL3vk4dFzS+jEfp2AEMQ/S0sBXA423y1Fdi9CiZHR j/jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DAA0AWXW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u24-20020a63b558000000b0055793097dbesi10729589pgo.469.2023.10.09.15.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 15:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DAA0AWXW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7031880EA8E6; Mon, 9 Oct 2023 15:34:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378804AbjJIWeD (ORCPT + 99 others); Mon, 9 Oct 2023 18:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378146AbjJIWd4 (ORCPT ); Mon, 9 Oct 2023 18:33:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FD109D; Mon, 9 Oct 2023 15:33:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 888ADC433C7; Mon, 9 Oct 2023 22:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696890832; bh=SqwELZKRRuBe3Ch6v8C6DiGONdk8e4b2k3YhcgPmCwg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DAA0AWXW50izTDwLp/Y7ZNeZZhO07pOVHrat8HIGbz1WDA6jbvuRM0nYtTNTlWsFS rwpkl4ie0RoQFWRpUMviigTIy+Kac4IPI6YngEHmJzxaj4S9Us9gyPW/6hAUoam0LB HkhDvyid2Mb1bYICOLh79Pd4h2M0zP566RFpO+dG8FEQIV9L4MPI7lpeMAOlmKMazj SK5ZCrIQR8MhU8fNtshHWYipAEH+Df9l5LTK6GGuChbP0imSgoYzmmSGPDD6QUCkyV FKo1ldIM73Hp4jNnlgxfV6OYLe8yvE0SH9OdeAyny5rgg8wPPVvMxJ1PEB2R+DFumh NLe70IWTq9uLQ== Message-ID: <2c877878-7e30-43d6-ba93-d37cc2fbb1ef@kernel.org> Date: Tue, 10 Oct 2023 07:33:49 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] ata: sata_mv: aspeed: fix value check in mv_platform_probe() To: Ma Ke Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231009124955.4046988-1-make_ruc2021@163.com> Content-Language: en-US From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20231009124955.4046988-1-make_ruc2021@163.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 09 Oct 2023 15:34:05 -0700 (PDT) On 10/9/23 21:49, Ma Ke wrote: > In mv_platform_probe(), check the return value of clk_prepare_enable() > and return the error code if clk_prepare_enable() returns an > unexpected value. > > Signed-off-by: Ma Ke > --- > drivers/ata/sata_mv.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c > index 45e48d653c60..df3a02e7a50b 100644 > --- a/drivers/ata/sata_mv.c > +++ b/drivers/ata/sata_mv.c > @@ -4125,8 +4125,10 @@ static int mv_platform_probe(struct platform_device *pdev) > hpriv->clk = clk_get(&pdev->dev, NULL); > if (IS_ERR(hpriv->clk)) > dev_notice(&pdev->dev, "cannot get optional clkdev\n"); > - else > - clk_prepare_enable(hpriv->clk); > + else { > + rc = clk_prepare_enable(hpriv->clk); > + goto err; This is wrong. The goto err should only be done if there is an error. Did you even test your own patch ??? > + } > > for (port = 0; port < n_ports; port++) { > char port_number[16]; -- Damien Le Moal Western Digital Research