[v5,25/54] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build
Message ID | 20230222092543.19187-26-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp473338wrd; Wed, 22 Feb 2023 01:28:41 -0800 (PST) X-Google-Smtp-Source: AK7set+K2u9RNFa3E96KW/oZqyFtUPBWlF9FLdaORQzjmF74/PtLXR2eyyqqZSqbjdC6y3w8Ki/O X-Received: by 2002:a17:902:e884:b0:198:dd3f:2847 with SMTP id w4-20020a170902e88400b00198dd3f2847mr11309554plg.21.1677058121281; Wed, 22 Feb 2023 01:28:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677058121; cv=none; d=google.com; s=arc-20160816; b=TGbW/vbIE+g5N01eWX0VPC82pSJEFsb+5zKAcfwbX5l3B7zHw97qrkjKSPPVak1nDJ 4OueHZDcnwvgLoDR1ERn5qjnHcXe74nbtgAp0gixKu3MK9LesvPqsyvWTtNEKyrjudFp Ftm/MS5S7Bur/IaM1uzVu1E7S5rJa/rXYjvSegerkC+jVrcj1vCtasNbzM+NeVsaAVDv 1+6TViNvldiNm2MHeW2bLlXP+zFwuwGQ7oIX4YGlkknrNcvzHUQB/V/ukI2453wLAOqE d2rLVd1azMWOu3Ye1MEOZ4vlcWxf4CG6+tOPAUl5g5RPxlBsKfr+o01yIgXnZMNpnDz3 tF+Q== 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=jV5eRz6WuCMtouVV++EUgssRVFovzuPzfprpSFBP8os=; b=D8TLC+YW1V7WMFPclZm+pa8Of5U3QeWcO105my6duvdjZXG4YGggZFsKjW6tNbsN6q 4LDpKmeWIR00f1+++US1jePfTNc6Bzu3OifKB+3w49COo+ZqE7QlRvtTTTY0nQejTzT0 zouoA2VvSOQJEVL3O4/sD5T+xkEgMmK1ZpzfloyJgArb6ig1BarAhP6JLCuoVJnAivXu ZXNMx6qoL1Gnn65JmSwYk//kihUEEk1lYS4n21SJpAUVqmu33V2OaH4/myXjzodJsyR0 eZdLmzgmcPEhTOIGESdq1nMmaakpMCEl1JcTmZw0P6Ka4v4RPCytHfh1vzxOyy1atWRi u0HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jLIK1Lpl; 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=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020a170902a38f00b00194afb5a3f9si15140799pla.164.2023.02.22.01.28.24; Wed, 22 Feb 2023 01:28:41 -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; dkim=pass header.i=@collabora.com header.s=mail header.b=jLIK1Lpl; 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=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231656AbjBVJ14 (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Wed, 22 Feb 2023 04:27:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbjBVJ1Q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Feb 2023 04:27:16 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D7D838E8C; Wed, 22 Feb 2023 01:26:30 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C01E866021BA; Wed, 22 Feb 2023 09:26:27 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1677057988; bh=kTtACXAEbNAgNCZdigRxep+XT4EJ4BHRbcIY5vyvaqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jLIK1Lplh62JGI2J0W+p96ybN3rDJUEZsw0Ht8TwnUVSRX6+YsU320e/lYfYF9stm QzBYP8jjJmNBgh92do6muZ+vnrl6PG/fTgl7al/HjevpKJ9e0IwIr8lFWkr84G4SyR Y5Oskai0eJ3pROA/fcw+UDJ+L+uPUzHyRODgCbBn9YRhusBYL8gf7uxAqQgMcdf5ln NJWnSLap6/bEV2Xo0rJhE2M0QRas++baa32elny12fDADcbK0Qf4UcTaZIuLrdRLBk Ps9E6Au0iSrxZG9WSbuYv0EJnVH2QMISZnpTmrH01pD83hC2ESzcEsCCYheKkdjcTb FYqmDYsxXelkQ== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: mturquette@baylibre.com Cc: sboyd@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, johnson.wang@mediatek.com, miles.chen@mediatek.com, chun-jie.chen@mediatek.com, daniel@makrotopia.org, fparent@baylibre.com, msp@baylibre.com, nfraprado@collabora.com, rex-bc.chen@mediatek.com, zhaojh329@gmail.com, sam.shih@mediatek.com, edward-jw.yang@mediatek.com, yangyingliang@huawei.com, granquet@baylibre.com, pablo.sun@mediatek.com, sean.wang@mediatek.com, chen.zhong@mediatek.com, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v5 25/54] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build Date: Wed, 22 Feb 2023 10:25:14 +0100 Message-Id: <20230222092543.19187-26-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230222092543.19187-1-angelogioacchino.delregno@collabora.com> References: <20230222092543.19187-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758522896632265557?= X-GMAIL-MSGID: =?utf-8?q?1758522896632265557?= |
Series |
MediaTek clocks: full module build and cleanups
|
|
Commit Message
AngeloGioacchino Del Regno
Feb. 22, 2023, 9:25 a.m. UTC
Add a .remove() callback to the apmixedsys driver to allow full module build; while at it, also change the usage of builtin_platform_driver() to module_platform_driver() to actually make use of the new callback. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> --- drivers/clk/mediatek/clk-mt7622-apmixedsys.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/mediatek/clk-mt7622-apmixedsys.c b/drivers/clk/mediatek/clk-mt7622-apmixedsys.c index 497fada797b9..a9f3057d7080 100644 --- a/drivers/clk/mediatek/clk-mt7622-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt7622-apmixedsys.c @@ -119,6 +119,19 @@ static int clk_mt7622_apmixed_probe(struct platform_device *pdev) return ret; } +static int clk_mt7622_apmixed_remove(struct platform_device *pdev) +{ + struct device_node *node = pdev->dev.of_node; + struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev); + + of_clk_del_provider(node); + mtk_clk_unregister_gates(apmixed_clks, ARRAY_SIZE(apmixed_clks), clk_data); + mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); + mtk_free_clk_data(clk_data); + + return 0; +} + static const struct of_device_id of_match_clk_mt7622_apmixed[] = { { .compatible = "mediatek,mt7622-apmixedsys" }, { /* sentinel */ } @@ -126,12 +139,13 @@ static const struct of_device_id of_match_clk_mt7622_apmixed[] = { static struct platform_driver clk_mt7622_apmixed_drv = { .probe = clk_mt7622_apmixed_probe, + .remove = clk_mt7622_apmixed_remove, .driver = { .name = "clk-mt7622-apmixed", .of_match_table = of_match_clk_mt7622_apmixed, }, }; -builtin_platform_driver(clk_mt7622_apmixed_drv) +module_platform_driver(clk_mt7622_apmixed_drv) MODULE_DESCRIPTION("MediaTek MT7622 apmixedsys clocks driver"); MODULE_LICENSE("GPL");