Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp360681lqo; Fri, 10 May 2024 02:01:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWiIJyS9Vsn7Iomg7ehFO3hAz9ZaIwDrLdDp5lvnKcvOCy8WFaV+sWvVvAPDZ8vyoUe+TdbvbSPCahZUDJFjP0scbcPIY230tFuR4GAoQ== X-Google-Smtp-Source: AGHT+IEd3XiSi0hNN95lOggLiUj+b9M27QJE7sWP26sxjNop1UUwNBRMQa+MkPkn2/GYOw/58Nn1 X-Received: by 2002:a17:906:7f13:b0:a59:ca9c:4de9 with SMTP id a640c23a62f3a-a5a2d67ad68mr136374366b.76.1715331700884; Fri, 10 May 2024 02:01:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715331700; cv=pass; d=google.com; s=arc-20160816; b=bVYPtH/TF6hqoH37/pEqL5PdS74kxUiosBgxWETIXcmm2O9nQxLki4DNwjATGyWY3t lVHkP5N+emdhEj61THAe4ICVkp6sX3JbD9263F+nakiErsbKhKSDoGiMl/heg0lADUzC Lw5almbidTMiQ/1R0gQJqgrdBY9/eBuSB+/SnBo15J2080PDBavpl8/SoSoafDImqQV5 cFgtHGn0MngTWezsw8nyerYLp5wDOIhnvOJqsJBVD9IxK6UjTECDe7rp7gDNZz4ANCB7 u1cVUWvRfa7eMO6RyineDT9YS6UM/Xic353CUSqFt/eI7Q+iRvn8Q4s8kaBBEnzS7HIc MzSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=A5kHqtPAbpK1JQILKP2FGgCyu6+/c6sr6KwDpLL+qlA=; fh=ghylgCo1pb0jwbmP+F2G1n2DgWJ7g7BizMlJja5tLn0=; b=JTd4shdjjbVVMp4QBznp0sblath3aeXS0JGPnjQDCX2WXQOY8KLTcuY72DTx8ah+FH NoFDoG9Xi6NKFVoH2nh5N99POrqSshkFWyGvJSe72+TdtbAbiqWRDsgimlamXwOCV8Zl RSRsH0xjEYcHq/RWARxdBXkcwEGqOCDWe3fn5PXWRKcT4SKwPQME9Hr3mghPvGKCodxj OWH1W3ejYwpq0FmXvBjxF1OWEzRxehzNsE9reCEmVSYaH7ygKjs/q+pFHQoA6dr75HlX /O3iMgfiTwfqEvp1w8dftsCA9XtBY1kTjPI8EzSsXWFbAiZzdQM6k9G/OXsmXg5TN94B Gq7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=iscas.ac.cn); spf=pass (google.com: domain of linux-kernel+bounces-175472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175472-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b4c589si190616566b.387.2024.05.10.02.01.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 02:01:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=iscas.ac.cn); spf=pass (google.com: domain of linux-kernel+bounces-175472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175472-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8ACEA1F21BD2 for ; Fri, 10 May 2024 09:01:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E44CC15FCE1; Fri, 10 May 2024 09:01:31 +0000 (UTC) Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E92D077119; Fri, 10 May 2024 09:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715331691; cv=none; b=HQbeFJ8hnaqFTigVzv2kyBqoQDl6TQ/tMSPay4oEs4JwbTfFQ58DfbzAG4FX0gJXnQWjN4dgD/A7fkuRpsnqpFg+d4CWPWHHpYRxm6dn8+RExw5+0+YJRpG777ONQ8byeSeg/k+9zFTYML1TqLxtDPFiR48KSJ57zNGQRpSThBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715331691; c=relaxed/simple; bh=MGQgGQ0Iu5HQ3Uu82ZP8L0jLXlDORQB5TOSq/IIUP34=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=JlpXj0F0Pbo+J3DQ8pItQvRPK4NuyoHpcWNrDIV285ISc3ODIR+pkgWHn8QIow8yP2ELBtPL1Hq2FwBcyZq9jqGygS8hiVJgofUq01FHMgKAX3z9QZKYf2kcn5kRiTFlp98ARi7Jy9ePcfmdxDrTi7VMZG0wmHs+5ZovVHKvgIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from localhost (unknown [124.16.138.129]) by APP-05 (Coremail) with SMTP id zQCowABXX+dg4j1mzzgOCg--.44565S2; Fri, 10 May 2024 17:01:20 +0800 (CST) From: Chen Ni To: vigneshr@ti.com, jpanis@baylibre.com, wbg@kernel.org Cc: linux-iio@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Ni Subject: [PATCH] counter: ti-ecap-capture: Handle error for clk_enable Date: Fri, 10 May 2024 17:00:59 +0800 Message-Id: <20240510090059.2126666-1-nichen@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:zQCowABXX+dg4j1mzzgOCg--.44565S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Xr47tF1xGF13Xr1Utw1UZFb_yoWfXwbE9F Wq9w4xZF45X3Wvkr12qwn8Zr98Wrn2qryxtw4vqws7JayUt3sxXr4Ivw1DC3yrZ3y7CFn0 yrnYyryxZr13CjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb2AFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r106r15McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8uwCF 04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r 18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vI r41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr 1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvE x4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUSsjbUUUUU= X-CM-SenderInfo: xqlfxv3q6l2u1dvotugofq/ As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Signed-off-by: Chen Ni --- drivers/counter/ti-ecap-capture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c index 675447315caf..30a269fa5da0 100644 --- a/drivers/counter/ti-ecap-capture.c +++ b/drivers/counter/ti-ecap-capture.c @@ -574,8 +574,11 @@ static int ecap_cnt_resume(struct device *dev) { struct counter_device *counter_dev = dev_get_drvdata(dev); struct ecap_cnt_dev *ecap_dev = counter_priv(counter_dev); + int ret; - clk_enable(ecap_dev->clk); + ret = clk_enable(ecap_dev->clk); + if (ret) + return ret; ecap_cnt_capture_set_evmode(counter_dev, ecap_dev->pm_ctx.ev_mode); -- 2.25.1