Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5909103iob; Tue, 10 May 2022 06:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBmOAhxDofsgaS98rXk0TEGYXExoukxvRr7r/O8XNvo5ySDClukkPNXPvXTdpjlOF0Olmw X-Received: by 2002:a17:907:3f95:b0:6f4:f45a:9f66 with SMTP id hr21-20020a1709073f9500b006f4f45a9f66mr19223327ejc.544.1652189508932; Tue, 10 May 2022 06:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652189508; cv=none; d=google.com; s=arc-20160816; b=IyrXrVlcfPOR/bZ2iwXTsALR1abKLg75DMxtj60gwNjN/mweLEN0dBhhua8BhvTvpI pd2n/T7xyvMAfz8rgXLpC3YS0y0iaxVV2aUyXj9TWlmO59+VXq3zn87DnMm97JLulNxa f3YRJOjiWTGNl5wxyUOP21hxFr7sT3yNjWQKO2St0Q8AK6HzwKs3H2l6/r3ZYfIQNzxP ttOUhizhXGbtHm3EvSbsprmYL0rM/pggnFwiW59vl0QHXBoF7WYi+m1zEiaALQDjqkAW 8wJvDFqXPvVsWq/ToYUK/3nnu1Al8fg3+Txw0g4WBVt+TnT8RNe2zLnBNHELjUNUoa02 g4aQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9ya570kQIAxuwgnTHVGLX3kmecG/HttO9ZeMkT+/ygQ=; b=M0qLPk3BsA5UJkRTE6qMKEzAHp1O/CaEXd5LIcdeTrS7Zl+PEwbi+teYvbmFMduT33 6k8d5N/AvsVMnC5sPQmMS2ibL8UkHZO772emYa9tmSY4/QpB6woLqd8RIhIVnzEOFAvL R3eqIhnZoqtHJjy7DPzj7My9MZ/a5HHYVg7vtEVZwS1ewwMO0yoVVCE/Qc9fxWpcQpd3 Ita+dYJs06+UCX4HZ1z3ygxLeUGNVCGH7hbSSNgL06PVHkChMopBx3LC4cS/SWtjaH49 2drCoeQEH4FEWjY37zcLI0NlL8r6kAjgq81GSaIabvB3/LWOUqS+bZw6R4YYTh7U9PwB kE6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gKnovVtA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a056402274200b004281bdf9050si21365618edd.500.2022.05.10.06.31.23; Tue, 10 May 2022 06:31:48 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b=gKnovVtA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240082AbiEJKwj (ORCPT + 99 others); Tue, 10 May 2022 06:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240059AbiEJKwO (ORCPT ); Tue, 10 May 2022 06:52:14 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB5A81BDD82 for ; Tue, 10 May 2022 03:48:16 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id o69so15523358pjo.3 for ; Tue, 10 May 2022 03:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ya570kQIAxuwgnTHVGLX3kmecG/HttO9ZeMkT+/ygQ=; b=gKnovVtABKGaXs0ew7Ew46WRae5W9XUyMaRi+BXWBsgdcPRWPTZkv81F1UTsdFhA+R 0bK5gYQejDadKl/CyZtRvtrZy0cO4xfwB11HHMczv8yuTjR0iz2hZMtWCOon4KnRr8U4 wCGMJJ16wP+oNIyhUjai4h+GSF0TZ5Cq0FvDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ya570kQIAxuwgnTHVGLX3kmecG/HttO9ZeMkT+/ygQ=; b=neQhies0fx5yRBmHA09Bo/ieYeXwMUwoZUPNHcfatadkRgndcgYjJA7dmw9jTlXDaB 4jsfILOtqQLjceClLjVJDEnxvGwgEpqJHoNhEjQO4bbd/gev7cVfoWAYuSwZ9OS4CdFs PaWkBhXVEedP3qh+NpLwr7PoR39QAHhb6sn2Y1ldpNxxTqSYCz0BVJ9V7JIBeqJ5VaDV RyQSoEruyIbSTYj4YdOmYx73vfCf6IeLEkLUDcZDXi5mqeCTTGyCOYGa47RT8npG2a6J LisqXcPP0WOTIhUYwU3Low0hFRhoSJJfeupHMi2UDE8kqHERQVsNpx7Ix1Y3OFan1Mu8 Uqqw== X-Gm-Message-State: AOAM532lMnrGnSe6BlEwKEBcp6TEF3fv8vBnccZpA2kUKWSXfGAlNa51 VBqtnFHZrqkiDGGLNK6WRCMFmw== X-Received: by 2002:a17:90a:1d1:b0:1dd:220a:c433 with SMTP id 17-20020a17090a01d100b001dd220ac433mr8066368pjd.196.1652179696544; Tue, 10 May 2022 03:48:16 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6dcd:8578:55cf:2b12]) by smtp.gmail.com with ESMTPSA id q9-20020a170902e30900b0015e8d4eb21esm1659691plc.104.2022.05.10.03.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 03:48:16 -0700 (PDT) From: Chen-Yu Tsai To: Michael Turquette , Stephen Boyd , Chun-Jie Chen , Miles Chen , Rex-BC Chen Cc: Chen-Yu Tsai , Matthias Brugger , AngeloGioacchino Del Regno , linux-clk@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 02/11] clk: mediatek: apmixed: Drop error message from clk_register() failure Date: Tue, 10 May 2022 18:47:55 +0800 Message-Id: <20220510104804.544597-3-wenst@chromium.org> X-Mailer: git-send-email 2.36.0.512.ge40c2bad7a-goog In-Reply-To: <20220510104804.544597-1-wenst@chromium.org> References: <20220510104804.544597-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 mtk_clk_register_ref2usb_tx() prints an error message if clk_register() fails. It doesn't if kzalloc() fails though. The caller would then tack on its own error message to handle this. Also, All other clk registration functions in the MediaTek clk library leave the error message printing to the bulk registration functions, while the helpers that register individual clks just return error codes. Drop the error message that is printed when clk_register() fails in mtk_clk_register_ref2usb_tx() to make its behavior consistent both across its failure modes, and with the rest of the driver library. Signed-off-by: Chen-Yu Tsai --- drivers/clk/mediatek/clk-apmixed.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/clk/mediatek/clk-apmixed.c b/drivers/clk/mediatek/clk-apmixed.c index a29339cc26c4..06400c043fe7 100644 --- a/drivers/clk/mediatek/clk-apmixed.c +++ b/drivers/clk/mediatek/clk-apmixed.c @@ -91,10 +91,8 @@ struct clk * __init mtk_clk_register_ref2usb_tx(const char *name, clk = clk_register(NULL, &tx->hw); - if (IS_ERR(clk)) { - pr_err("Failed to register clk %s: %pe\n", name, clk); + if (IS_ERR(clk)) kfree(tx); - } return clk; } -- 2.36.0.512.ge40c2bad7a-goog