Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp455283pxm; Wed, 2 Mar 2022 01:48:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxuGQt7vbpqJUrNVkQgtWMlyEFRNg4oLBcYOJ7EJ2DumB8mNm7XwxnHuSVe1FCozgkAFZu X-Received: by 2002:a17:906:a145:b0:6ae:e45d:15b6 with SMTP id bu5-20020a170906a14500b006aee45d15b6mr22559743ejb.714.1646214508426; Wed, 02 Mar 2022 01:48:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646214508; cv=none; d=google.com; s=arc-20160816; b=YDkjCuef3Tifs8BUQe8UQ6+/sIEC0dLNsuvDWlFld//gndzTTIdV4cklUpfkeJS8UF SPd7uE3s//e22+y6OwKvEExUeGN8erXavBR9qUh7K6QR93quYDy5B7s/O+qMnHmthAoZ TUqxFrG1c92RNaBsJbEkCKh66T2g+MNTlKrFipCfxrKb4yjsZRTT/ujeChf/JzyiFT+4 elCiGdr4U0fjAG21BOxppDuz1qmpjn4rreqhC9Go83VhIUDklC1O8ZCjDhpgPGUDUtPE B5G5WH7ZYkM+jxAArUu/lEFSyasf2suVXNAN4zenDAHEYliK0bGNGIprNlklDTwM+htA boWg== 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=g88CTjstChmTaZgDpJOSqbaDWQDe/eN3EfIVHATu0mA=; b=jrz/NBPONd0nEpmygCALlsPwwi5NK1ofAtrV4MpgKfIcN6i8Op2X/ZUG6ukR1Ej9i+ JdEbcxc6NGgviRN9yMcmz4zr3G1K0Z+VvKLu57qPBL9COE6z5iRNIQoIgYFScdL8pTBq w9U1HKh6swU+VQeUVXyLDxJ4OxYFKvLIX1OmhnH/tYB4CG5rE+Frb436WBahuD8E01EG 1p/LdaUVQRCwR46mI9ADsxwyr9v1v7421pwSLcUCC5pvHL9nhdeAvIo7OBfkHF0GkrwS LIIJeRIHPMZ+QDtnxeTiNgHARkAxaI9qQuhF7b4LZJzNWxVQ4wwdL9dEWc9WzfQeZnzj A3SQ== 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 l17-20020a056402255100b0041354ffd635si14639560edb.614.2022.03.02.01.48.05; Wed, 02 Mar 2022 01:48:28 -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 S240178AbiCBIt4 (ORCPT + 99 others); Wed, 2 Mar 2022 03:49:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238679AbiCBItz (ORCPT ); Wed, 2 Mar 2022 03:49:55 -0500 Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1622F4B853 for ; Wed, 2 Mar 2022 00:49:11 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-01 (Coremail) with SMTP id qwCowADnhsR_Lx9im+EFAg--.50148S2; Wed, 02 Mar 2022 16:49:04 +0800 (CST) From: Jiasheng Jiang To: codrin.ciubotariu@microchip.com, arnd@arndb.de, gregkh@linuxfoundation.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@microchip.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] misc: atmel-ssc: Handle error for clk_prepare Date: Wed, 2 Mar 2022 16:49:02 +0800 Message-Id: <20220302084902.96651-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowADnhsR_Lx9im+EFAg--.50148S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZFy7Cr1rWr4DXw1UZFWUurg_yoWftwb_Ca 1kZrnrWFWrCw4Skr17Jr1furWv9a1qqF45XryIqa13JryUA343XrWYvFn8ArWfuF4Ik3sx G3ZF93ySkrWagjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8ZwCF 04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r 18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vI r41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr 1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjfUOnmRUUUUU X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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_prepare(), it should be better to check it and return error if fails. Fixes: eb1f2930609b ("Driver for the Atmel on-chip SSC on AT32AP and AT91") Signed-off-by: Jiasheng Jiang --- drivers/misc/atmel-ssc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index d6cd5537126c..e0207e837e35 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -25,7 +25,7 @@ static LIST_HEAD(ssc_list); struct ssc_device *ssc_request(unsigned int ssc_num) { - int ssc_valid = 0; + int ssc_valid = 0, ret; struct ssc_device *ssc; mutex_lock(&user_lock); @@ -57,7 +57,9 @@ struct ssc_device *ssc_request(unsigned int ssc_num) ssc->user++; mutex_unlock(&user_lock); - clk_prepare(ssc->clk); + ret = clk_prepare(ssc->clk); + if (ret) + return ret; return ssc; } -- 2.25.1