Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3830580pxm; Tue, 1 Mar 2022 06:18:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2RnxeCiZF540w698ahIi73+sMcc+g9FjYpkr1HE7cAuqMbUC5uqL3znky9zwEX1kVLvlR X-Received: by 2002:a17:907:7704:b0:6cf:48ac:b4a8 with SMTP id kw4-20020a170907770400b006cf48acb4a8mr18643788ejc.305.1646144281003; Tue, 01 Mar 2022 06:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646144280; cv=none; d=google.com; s=arc-20160816; b=mcSuX6llnf/AlsQAnIbcWSuF4DF0pe97h6lqnAnaEKtSC0p9OBlil//3W6/ov88pX2 ZdtAqdrdAnG1szUTmWIghx+uBR1DJSXt2PFYy9oWPoMW6Ihb7H7lVphQe9QcYik7X4fM wtdPwKw9BtVhM9bPEZH8khY8b0SFEfor1Et4KvzVI3zscnmSN77/6AoHU43DwV9IHi3o BKK5BHclwEXswcbacIEAk961udESJxVLkCpgGaZHth13E4hFwHjeo5EZUyb8wJRB1J58 sRzHRa8LMVUQPWBI1VCqqq4QH35YUNDJb9EnHrGhQfi9EcwHs2utakLAYEErKay0Awzt C+Uw== 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; bh=mtwxFQzjNY6GKIE+EhxDgcGZE4gM0Gcj8N+0G+1LdaM=; b=kC3MLu6PARXDf6Aol5LTXAWIwHhjrFu/OGwuS5uwuM8BVcf9KXOJpuPWsMQY9ynElB 6eT1jn491M/wwwcT19Oj/Y34mk5YdMJKdvc64FAeHEvqdN0RP2eZxIcIkIHDxrfSDq+S yfu6PIniaYGFLIoJR11M4WRVolG37BCDr0F129jH/KS2BfzQu2743/HCKA7cYMb8lHzN 8HM/rwQZgDMdtgp3VtmHPPlN8OxdHH32kE7sJkvp4QivyNaYdNHFZ56zazt67m3KA81m Ww7VFHHQSRWW+2rXJhl0nKW+rMLMyqtXJdrcz8gxH/GRWxG4KukHAQE2i6sYxXHmW+om 9rAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a05640208cb00b00414d52152e5si993118edz.204.2022.03.01.06.17.37; Tue, 01 Mar 2022 06:18:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233099AbiCAHtD (ORCPT + 99 others); Tue, 1 Mar 2022 02:49:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbiCAHtB (ORCPT ); Tue, 1 Mar 2022 02:49:01 -0500 X-Greylist: delayed 484 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 28 Feb 2022 23:48:19 PST Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D9C311A13; Mon, 28 Feb 2022 23:48:18 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-05 (Coremail) with SMTP id zQCowAAH6vLHzR1il43WAQ--.23837S2; Tue, 01 Mar 2022 15:39:51 +0800 (CST) From: Jiasheng Jiang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, f.suligoi@asem.it, kuninori.morimoto.gx@renesas.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] ASoC: fsi: Add check for clk_enable Date: Tue, 1 Mar 2022 15:39:49 +0800 Message-Id: <20220301073949.3678707-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAAH6vLHzR1il43WAQ--.23837S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Xr47tF15uFW3uw4kKFW7Arb_yoWDCwb_Aa yqg39xXa15urWfCF9rJr4DA34j9r42v3WUKry0qa1ftFWUJwnxur4UZ3sYvrn0qw1F93s3 Za1DAr4xAr43CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb38FF20E14v26ryj6rWUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2 Y2ka0xkIwI1lc2xSY4AK67AK6r4xMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r 1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CE b7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0x vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI 42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWI evJa73UjIFyTuYvjfUY-BMDUUUU X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: ab6f6d85210c ("ASoC: fsi: add master clock control functions") Signed-off-by: Jiasheng Jiang --- sound/soc/sh/fsi.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index cdf3b7f69ba7..93cfa77b8b54 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -816,14 +816,26 @@ static int fsi_clk_enable(struct device *dev, return ret; } - clk_enable(clock->xck); - clk_enable(clock->ick); - clk_enable(clock->div); + ret = clk_enable(clock->xck); + if (ret) + goto err; + ret = clk_enable(clock->ick); + if (ret) + goto err; + ret = clk_enable(clock->div); + if (ret) + goto err; clock->count++; } return ret; + +err: + clk_disable(clock->xck); + clk_disable(clock->ick); + clk_disable(clock->div); + return ret; } static int fsi_clk_disable(struct device *dev, -- 2.25.1