From patchwork Mon Feb 20 15:00:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 59504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1354834wrn; Mon, 20 Feb 2023 07:04:57 -0800 (PST) X-Google-Smtp-Source: AK7set8jHBOpGPdh6al2LoY/vep9Mc/KzKTAIACuDF8eTayiKqYgCQlED3Cio29zgPAc7Ek7E/QI X-Received: by 2002:aa7:9505:0:b0:593:ed9c:9f07 with SMTP id b5-20020aa79505000000b00593ed9c9f07mr1092737pfp.27.1676905497233; Mon, 20 Feb 2023 07:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676905497; cv=none; d=google.com; s=arc-20160816; b=ox1Lz02u4TlQbf/6y53F6ewh8U8d0z6e9leJYmIUqPIrGfoAwaxVDqkN+yrOaWd0Do sG6ukpnkCJshFrcU5RgeZf7xDuqKHF8CAYshfYrAfsum7ABpyf9Pg2zJV1jczgibGypR f7eEmWLLRuUab0mJCcPu1SxRyBvB0SnhFcGlo1xgmiJzWQNNfhMwoDP0Wg8R1GpdaOE7 O6+SoEjzUQ5zxtiMIwLenuxeQaZUnwWzMU6B84ITx8AxDxTuf/VH9liGy1HQZdBJLZ9H 9m7VjBMPUD1u2gjIfmwUj43iMEPagV/AfYdFuhiA1ihAxPVk74M+ekpl7E8oC8mw0TIZ 7H9Q== 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=tY+K8MRhE0Gr4QVcztNxalX9ivjLOHNAwDN0BjW75w8=; b=Kzv5rzFqqKcdLrt/WeA+HJ4sWvwhEbnJzsDoaMlWFKsMf06k10QI0VZur4ySSRiJTl EFcK8XvRdjsMUJY7uRvm/pyvjsU3UBeL4amMbaBLM2zO70Cr7+WPkc5+7BVRz6P7ayV5 abuIN7qu8iGfA90nhXraAZecyrMdq/hzC8EsvlpiAfmDE2sMxWF/UaBeyHuZ/UQNIK4i UtfYQtzmWL3lcVIGYBXbq8XWv7aSqPxh9og1/XMmc+3Nm2vpl6knXT23U/PIQHw/XTn4 7kjnsy+fjRTHmvp8mV4u0LxW/kgpfc0JSJ3DTA2WHoHveE0Ax+XriB8WOx+VDWtIWSyE xz5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S+QKTzOP; 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 p28-20020a056a0026dc00b005a8ee167e52si3887881pfw.325.2023.02.20.07.04.18; Mon, 20 Feb 2023 07:04:57 -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=S+QKTzOP; 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 S229986AbjBTPDd (ORCPT + 99 others); Mon, 20 Feb 2023 10:03:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbjBTPC4 (ORCPT ); Mon, 20 Feb 2023 10:02:56 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4533A2056E; Mon, 20 Feb 2023 07:01:53 -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 2342C660217D; Mon, 20 Feb 2023 15:01:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1676905311; bh=T91Ba3/qDGf8sWWJXdHxINm7g/vf3TN99/lK3EA+d84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+QKTzOPirQoL+nnyWmkVbLGda6NSB+cQyii7xHxVvIo5iGwvB3N8GQNMNDWPjeL9 GETLl2tb+noVzjdkkQNo4MNztgG/nwvkgTuMgWKWRbcMEenUxXrEDh03WZF82qugZ+ p5xMO2YVAlJsbanrTGuKiMdV4ILqz97e3UUoLiQ052HktWGH/0gAspKOJAEdLIa+PQ 9LgU7WdRHYBQScCgg1VVuvz25xljvtW9S3eYSvkmfDodxIevgWQJ9yYlQbo6TqB615 rwoja89AqMZpm/ejnknOAS/JuS5FXzJQXPUhXCZ27+/3NuPL1njzgfTJ/F+gNTA//e Q+Ow2hVuoZUXA== From: AngeloGioacchino Del Regno 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 v3 25/55] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build Date: Mon, 20 Feb 2023 16:00:41 +0100 Message-Id: <20230220150111.77897-26-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220150111.77897-1-angelogioacchino.delregno@collabora.com> References: <20230220150111.77897-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758362859021284318?= X-GMAIL-MSGID: =?utf-8?q?1758362859021284318?= 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 Reviewed-by: Chen-Yu Tsai --- 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");