Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1013780pxb; Wed, 6 Apr 2022 06:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSWQtMS0vh3rpLvrSx7817+5EwDYXf3WH0yZRsiZhPxHQ0sVQSoj9goIUuStwgpZqdL8NF X-Received: by 2002:a17:902:d5cd:b0:156:6263:bbc7 with SMTP id g13-20020a170902d5cd00b001566263bbc7mr8892722plh.160.1649252663021; Wed, 06 Apr 2022 06:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252663; cv=none; d=google.com; s=arc-20160816; b=w5ztwvPevzONCMPf+ewHmkyC40Xi1yV2UkrNNosizbUrZ7sVebUW3aagEcRsQYPaEX Ib0cpmh5Axjl5V6muiPmZsGgdx78HKz8vUIfAtYLl2pn87rkk21vbY1ctXadyK9xEW0p dTKi7WRZCFSxRTDhTq2fqEevYZJGmja2a8j/ft3k59HedNBFx8/7poQPrBu4wh8GI+gt Nv+Br2LZ9JUcHT1z0MCTC/v7s4ikbtngsS7J8Gp/8bMypBmomgXTAJ2oJEaUFjSEy2kh 2xN2kW+Ao765xD1N5SUmRwoCHxy+d9s9rcX3ncv9bts+SLDFgX4fl/MEUpnhRs5prmcV W8Ig== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=070r0h93NEnGsz/bgJw4zxH3Nllt991n+4BJ5qGMQfk=; b=mXUhbtvmFqqKOqsMpi193Oyd/rqwtWDBCzLL1tpEyB1qCtqcCvG97WI6RQfhxlCSJ/ Bs9pH521BqLm8RdryL693/aOJgbAMB3KN8q5dtvY2Hyt0b/9hZSHqzTftaur3X2Al0UG FHOrqme66ZiW0x6ftfdGqEVqkT6sdlpvOa4pT7+rM3lIZrAOg4jD9jLm9pTU8IViBpFv o6JifkBGqPWSbtAXokhRHaBIjJSRFoJZSY6W5iwWd2CEInu4EJps+rFtYh64/411WvSs anZ5hBTwmRPr00xDBYgO+vFTReVjs8vias0N9MOk3ZaId/KIFqeSa2IGmqRIh4LngfRH 5KfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hBVLSiYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f18-20020a170902ce9200b00153b2d16509si17402278plg.273.2022.04.06.06.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:44:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hBVLSiYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8F0B845BA7C; Wed, 6 Apr 2022 04:31:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1835439AbiDFAb2 (ORCPT + 99 others); Tue, 5 Apr 2022 20:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348333AbiDEJrb (ORCPT ); Tue, 5 Apr 2022 05:47:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EFE66CA79; Tue, 5 Apr 2022 02:33:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6C25C616D2; Tue, 5 Apr 2022 09:33:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E77CC385A2; Tue, 5 Apr 2022 09:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151223; bh=l24cq07F/uZePHJYQDOzOWHxywiUK86wqxjzTcVLCJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hBVLSiYNxdFApJf+hlXsajkkB9RQ7onowIqMD6WH9oQouc6wkdkaSLFB5j7T+VZVC lyNblLu2qo1fShtJFqVwmZwwKoQbVRhci2eMh/zMjxng9WfSdcHVHTFTLp/ftJuQyo kJgMsV92fFuvfUOryJMKO2guIy6SyQCLIoXIMKMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mark Brown , Sasha Levin Subject: [PATCH 5.15 339/913] ASoC: atmel_ssc_dai: Handle errors for clk_enable Date: Tue, 5 Apr 2022 09:23:21 +0200 Message-Id: <20220405070350.009914326@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Jiasheng Jiang [ Upstream commit f9e2ca0640e59d19af0ff285ee5591ed39069b09 ] As the potential failure of the clk_enable(), it should be better to check it and return error if fals. Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301090637.3776558-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/atmel/atmel_ssc_dai.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 6a63e8797a0b..97533412ce11 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -280,7 +280,10 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, /* Enable PMC peripheral clock for this SSC */ pr_debug("atmel_ssc_dai: Starting clock\n"); - clk_enable(ssc_p->ssc->clk); + ret = clk_enable(ssc_p->ssc->clk); + if (ret) + return ret; + ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk); /* Reset the SSC unless initialized to keep it in a clean state */ -- 2.34.1