[v4,25/54] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build
Message ID | 20230221115549.360132-26-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1822631wrn; Tue, 21 Feb 2023 04:03:15 -0800 (PST) X-Google-Smtp-Source: AK7set8tkax5N3adJwSN5ESNyIDhUwGnefOuezpxNRuTfVOfbbTay2445ONnmc9lSBj9w6L/63Ne X-Received: by 2002:a17:906:3bc4:b0:8b1:7a80:e13c with SMTP id v4-20020a1709063bc400b008b17a80e13cmr15812566ejf.31.1676980994861; Tue, 21 Feb 2023 04:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676980994; cv=none; d=google.com; s=arc-20160816; b=Fgy7meGJgmZE/AuLECcrjJlipJMmpLJEVwPh4t0s3tVXGTJbyoaCeyeJzTF/3kI1yS Ps2L/CX6x0FcdWLPOQNc6OlmD8tNy/e1frO/Ut/kVsKIlggTWIQY4a57vvJPwYv4MOen 0QllgS0c+4QRD+jbHkP7hiQu6aSBSfxvFI26y78Xbwx55UZxOh4M39w9C/jq2fB8MF5m QgFlLxrOXrUWVRDrZfTeYeI5MATUQQJ3Pj+xjJKRf3OK+paVpmkUvGwlQI6xsy+w/F3Y hti3pRXeABS3dFza5Yp3ty8TfSRbKvuHm23iPicAh2oP/mYTqtiAaAsGIhdPsizweuqA 7oNQ== 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=MytDixIgDc7LlfyHcOI+zAGLl/19v2/wtZEHAryFNZM=; b=KW0gDVI1UbgwiWDz9W+mPiYzqnQOTHVm5ylLjdFiabvam4RVX1Dz/SQw7njyG3JsVk 8wUVJH67RegJm59gsqTgmeKbXgHCCl9kXyoAEjsfVUW7n8DlK5zK+Z9i0vS19QoMvfnj NjmwnwVL9EDFXl5vK4FYCURX/A8o9SaOSAQN3QugCu9RXoflmvP9bXTg/GEyN5j+IrNt InXptIDU8fHW00svDLXHlXGu+xPmTcs2Mdt+61fThz8hnUPU3FJoAWB5tFpTEcvhZR8P OSnrMqDC5S05zAYRgM4p9SZ47wzwNo7iYnSeWVwvUpcm9oc83GRaqGCVwsSDmrWrY/y5 nb3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CnG9StYF; 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 20-20020a170906101400b008b175a0717fsi19738330ejm.396.2023.02.21.04.02.52; Tue, 21 Feb 2023 04:03:14 -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=CnG9StYF; 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 S234546AbjBUL6r (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Tue, 21 Feb 2023 06:58:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234606AbjBUL5z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Feb 2023 06:57:55 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10E528857; Tue, 21 Feb 2023 03:57:23 -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 6362366021C5; Tue, 21 Feb 2023 11:56:27 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1676980588; bh=5lsWTL44Y3yaPQVQKBeDRjlBN2RQ9pIDlAdrKv46Dog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CnG9StYFUGqzQMAUL91GdKOZ3kDvHtG0QdET45TXZpSeLekOWDqzB2yP4fsL1t7pW A9VLdzmluEw9Zd0kIMUEK4lZ+prE/Inl7T2yEjVREjdsEcYQEj5MaDDasc5E0AyWoZ EjD3hv9tpNp9stJs4zsfboYkOsptmC/yf8wpO7A50K2oOACR4LI/MGWmVrXmv74lXU 3ymky/CF0IBNKNjQSW2DCY2JLGAjQK4OFup4APrbGYAD0HQ90jRxgf44mrYY1THuLa 6zoU5+iEMQldaAOpt2OZdnnCmjO0l8DPRIrxr+NY5XlyLJVQIOkol1sV3QuXpTSMqX R0N6FvbKtN35w== 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 v4 25/54] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build Date: Tue, 21 Feb 2023 12:55:20 +0100 Message-Id: <20230221115549.360132-26-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221115549.360132-1-angelogioacchino.delregno@collabora.com> References: <20230221115549.360132-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?1758442023502644415?= X-GMAIL-MSGID: =?utf-8?q?1758442023502644415?= |
Series |
MediaTek clocks: full module build and cleanups
|
|
Commit Message
AngeloGioacchino Del Regno
Feb. 21, 2023, 11:55 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");