Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp98342rdg; Tue, 10 Oct 2023 05:30:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNlIoaPbft1LNUM8PZesLxNABIaFDC7A5D0N7jl6wfbeDYQPGQ6tZAcWF+Po1O62srtMPr X-Received: by 2002:a05:6a21:789c:b0:14b:8b82:867f with SMTP id bf28-20020a056a21789c00b0014b8b82867fmr17981495pzc.50.1696941002099; Tue, 10 Oct 2023 05:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696941002; cv=none; d=google.com; s=arc-20160816; b=Nal4M1Y7rvvqByI6SA9JS16Pn2kx18XudDMeKm5uFJuMqntUO+zKLKPbB4TIRN6Wwa 7zj8WOa1uLgy51OBQaiEY5pfwqnvoYE+D36UhhjQmDbJGkbJXAR3B8CSUjeOSbZjuD2b 4i3HaYOA+Pn52xgdVxmeLANP6YVb0VHkaPRadXcA4vQotlpADtnQizDAVLsE/F2MaQdM iNSkeqMZnXycdANUj8YN9h4ZUPNBLqu5OmeDIup8qJh1hnQoHeX+A0+XXECEQviLu6Gh F9KgfgzPDNMmeQdPPgq/uLUAFWSYST26yJ6GxeU2EloJz0vtqfD8XozFIVH5mq1PNlbD B+Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BY3yDGeIefIcA+vHv8W2LLY7z7fayTNU7z5yohmsntw=; fh=sid8UmHUAKvWTbGgYgy451zQQWyekXz0REvNLkjluQg=; b=TJWmMsOFQILnQMsYJExpEQ7//JRDohXHLfs1ILBnAq1J0aDuYkwYAv6S3GcXgDpmau rFA6D5+iH5BpNIn95lVTAVk+R5DMa1hCIXAC0HDrobURV7kGsEsNKvv6Kej2MILC2Swc xxwKnx+3xordkga8MUCC2uEwakMTiiVo/b7NrYVYLpkbLiy02sWHUmTgg0Wd2wzxnvMO e/qPx2j3S1yK1pIveZldIh7/xpu3Z0p8takgpUaQD8gJ6T25sQ90n5rOzfwVmhtRCJqD Q/ZobLeq37XRCpO/rhV73L5ddTPyr5LVzrSKmJKM/0pFXQSDPcZRjvtgdqACwWb2X6lb vO2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="LWoGh2C/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h15-20020a056a001a4f00b00690d42e334fsi9576859pfv.181.2023.10.10.05.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="LWoGh2C/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CABC08025807; Tue, 10 Oct 2023 05:29:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231398AbjJJM3v (ORCPT + 99 others); Tue, 10 Oct 2023 08:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjJJM3u (ORCPT ); Tue, 10 Oct 2023 08:29:50 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.214]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 015B1B7 for ; Tue, 10 Oct 2023 05:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=BY3yD GeIefIcA+vHv8W2LLY7z7fayTNU7z5yohmsntw=; b=LWoGh2C/IearcCMUiW1Y7 dJcrvRz3AOju/9s45pzB4qHJT5Y2TMPFycHwpbUi/RCv3l9WPW+IZopRflnawPke zOg+jbFmQ4qFRiYpbOfTI72d9yQiGB5vQ7xeIBiny4xTqnCHXqccFvOGu+q/sZPh 8AVccGaxgBAxA5XeFOcMWo= Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by zwqz-smtp-mta-g4-0 (Coremail) with SMTP id _____wBnTtWdQyVlOE+vAA--.52111S4; Tue, 10 Oct 2023 20:29:30 +0800 (CST) From: Ma Ke To: dlemoal@kernel.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Ma Ke Subject: [PATCH v3] ata: sata_mv: aspeed: fix value check in mv_platform_probe() Date: Tue, 10 Oct 2023 20:29:16 +0800 Message-Id: <20231010122916.4080132-1-make_ruc2021@163.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wBnTtWdQyVlOE+vAA--.52111S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4rAw4fGw18tFy5tr17Awb_yoWftFgEya yxu39rWr429FnFy3s8Xr15ArWxKFWvvFnYvas2yw1ayFy7Xw43JryDXwn8uwsrWw4kuFy0 yr1UC3y3Cry5JjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRthFxDUUUUU== X-Originating-IP: [183.174.60.14] X-CM-SenderInfo: 5pdnvshuxfjiisr6il2tof0z/1tbivhQFC1ZcjDjUDwAAsB X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:30:00 -0700 (PDT) X-Spam-Level: ** 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 45e48d653c60..e82786c63fbd 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -4123,10 +4123,13 @@ static int mv_platform_probe(struct platform_device *pdev) hpriv->base -= SATAHC0_REG_BASE; hpriv->clk = clk_get(&pdev->dev, NULL); - if (IS_ERR(hpriv->clk)) + 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); + if (rc) + goto err; + } for (port = 0; port < n_ports; port++) { char port_number[16]; -- 2.37.2