Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp828088rdb; Sat, 7 Oct 2023 00:27:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGenzgsZ+hVoXRV525bqYrOpeRSYY5uQEZortclVPxKIkomE8GizJe9W6f3bFdDFB1QIqp8 X-Received: by 2002:a05:6a20:42a2:b0:15a:290:d83d with SMTP id o34-20020a056a2042a200b0015a0290d83dmr11418507pzj.41.1696663648486; Sat, 07 Oct 2023 00:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696663648; cv=none; d=google.com; s=arc-20160816; b=YO478CbxbQefxSbwYtKIXEqLJ0WyqyI6oHhMlzQglRhMxX5VZ5iYSIudbKV+mr4hs9 Qbr4WYDeE30xL9fnGNiv5Kj3Ji5q0QyZ1oqzTMLnLAJmiMuHcxVUkHLyZUHstKBx+b85 V2XejnWm2ISdL6p92oAqNAn0d7uP2wR5aFTOWxMQA94LYSbpsbrDTYYitoy4yMi39tBc LZVTxOLrMau+S6LX79rFBfgOcR8oS7lMa39DesEiLa4ZHVVdlTGJ2RL7vWcSMFF69a3C 42Ml8fPrucmhadjoWzPVL2yCOz6z00ynrZkBgPja4j8NbBPh8cjMaoA6Cfu4gEF2/Lne /epA== 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=WB7nKi52YjLc4sG3q3T1xtcsv16IVqBRlO8CrGHAiyQ=; fh=sid8UmHUAKvWTbGgYgy451zQQWyekXz0REvNLkjluQg=; b=yaj+3dLeI6kRf2ZYyhcld3oCtVT5ld7qBJD3+gcpeGXIx0Jv+Lmi9U6G7Yd2Jyi4jW 8oGGfB7iv16YQ19zrZ24VRb0wKjTaLjlGn4LRLUdzEAc/XttxDfjfRwOMExDd2A3u/Ws MShe8jqABnJHEZJxvJlKlLmDqJ2n1ohev4gYquIKMWSo0Gvm+wxc60KJAXQYCH1vubTN zInL2JHNbnm0n1UBTIOXSimqsCdylKsGRwZoGQKfWCAKEuHhJtFTcfY3eXWY3LgJif/M NSU0dCdCln7MP6td/5NXe6pjOT/LRElDvLSHR69bVlKDl0WsMU1X/zNV8g3oKCe3UlKc 4Pnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=TWSEngi9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d18-20020a170903231200b001bbac6722e6si5786878plh.371.2023.10.07.00.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 00:27:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=TWSEngi9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id B0A8C802885C; Sat, 7 Oct 2023 00:27:27 -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 S1343671AbjJGH10 (ORCPT + 99 others); Sat, 7 Oct 2023 03:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343598AbjJGH1Y (ORCPT ); Sat, 7 Oct 2023 03:27:24 -0400 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 390B8C2 for ; Sat, 7 Oct 2023 00:27:21 -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=WB7nK i52YjLc4sG3q3T1xtcsv16IVqBRlO8CrGHAiyQ=; b=TWSEngi9Ng51AvfcInrg1 XNiGPvm3Qd1zYFdbMnUqX+CRFkdintfb07NQ/aBH8gmGfT2FBNdkiiuBb4Gsf3aZ /NWKABl0x2Ry9cM1fcW5KTWibu+07QtUoAAhu6JAaCsInoPOIt+sDy022Q13hRSP EvTmijHUD/Pa5MH9geMWqQ= Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by zwqz-smtp-mta-g1-2 (Coremail) with SMTP id _____wDncjVDCCFlWnx6EA--.50896S4; Sat, 07 Oct 2023 15:27:06 +0800 (CST) From: Ma Ke To: dlemoal@kernel.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Ma Ke Subject: [PATCH] ata: sata_mv: aspeed: fix value check in mv_platform_probe() Date: Sat, 7 Oct 2023 15:26:57 +0800 Message-Id: <20231007072657.4001311-1-make_ruc2021@163.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDncjVDCCFlWnx6EA--.50896S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4rAw4fGw18tFy5tr17Awb_yoWfXwbEka yxu39rWr429Fsrt345Xw13ArWxKF4vvFn0va4Iyw1ayr17Xa13JrWDXwsxu39xWw48AFy0 vr1UC3y3Cry5GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRthFxDUUUUU== X-Originating-IP: [183.174.60.14] X-CM-SenderInfo: 5pdnvshuxfjiisr6il2tof0z/1tbivgoCC1ZcjAVt3wAAsM X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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]); Sat, 07 Oct 2023 00:27:27 -0700 (PDT) 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 45e48d653c60..96f9841aae6c 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -4125,8 +4125,11 @@ 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); + if (rc) + return rc; + } for (port = 0; port < n_ports; port++) { char port_number[16]; -- 2.37.2