From patchwork Mon Mar 6 14:05:14 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: 64732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1877431wrd; Mon, 6 Mar 2023 06:40:09 -0800 (PST) X-Google-Smtp-Source: AK7set9snGtDkDjpEctWsArcdu5NKLR6yol3sFnFe8qGtA+dNj905k1/xRJ33f6Ruind3M9z6ctW X-Received: by 2002:a17:907:2075:b0:878:714b:5e16 with SMTP id qp21-20020a170907207500b00878714b5e16mr10670703ejb.28.1678113609553; Mon, 06 Mar 2023 06:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678113609; cv=none; d=google.com; s=arc-20160816; b=pexwVgbb3l2qM+IWjwNBOlsuSa7URgThaSGDTDphyRmlsF4GhfvARnM7E1XrKg0ujl baUPCSB5V3Er9liNlAMpPG6OBqWtlxdXsxOYsDDyUEMy4NP0DAcBQwmu1NBFN0rpg4AL fEMx4V99CDUTEQ1MVBY0zPT15imrTW4BgYT+TiX2505aEXnPnb8JmB+OAEddI+J5YjDA +Iu8aP2nhIaBe37aovLBr9eHo1AwEmGWmPB+Hb8hQi0duD019ZOh2jSJjp/s47M4taEe v6m5Y+WQMqRyuh5l3KDuJaBkc/Ih50Bn7kQsYnn2fb4jU2F4zDxUFsKhrekD8JTaCqZm JjzQ== 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=nJ0u4SNYBQag0dJd2Jg9Y6FLrsj6HH4HyCmdbkRN5rmRa3UA/t9tfXkutol5QWWTU5 mMOgrV0sJRZJPkqs9oOX87f5t/0a8MqNhLPCCBn1S+W1FWk6Tl4cDQmZQwP9He1CIdhW 2T+gY0TqmLrQoShGeT9bFec7MIWnmAqwkbZc6/WHW254vzI/t2N9F6CtWCQuDKix6XE9 swClmX+OFCQkogsvG6PSlfDIHf14oyJhIxbm4MRH9m3PIL9JPLG+eUZSxfYCrnJ1Cl/O XLUV1PrLmwyT62B1ZdC1DCbEzxT5hLwjJ5gLE0S5RT0DDoreQSLc0sAmHwhtROh29qR8 kK6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GTCjZDyb; 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=QUARANTINE sp=QUARANTINE 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 s13-20020a170906168d00b008f0ba0949e0si4574253ejd.980.2023.03.06.06.39.45; Mon, 06 Mar 2023 06:40:09 -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=GTCjZDyb; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbjCFOXD (ORCPT + 99 others); Mon, 6 Mar 2023 09:23:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjCFOWo (ORCPT ); Mon, 6 Mar 2023 09:22:44 -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 97CC4360B9; Mon, 6 Mar 2023 06:21:19 -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 AC5B16602FDE; Mon, 6 Mar 2023 14:06:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678111588; bh=kTtACXAEbNAgNCZdigRxep+XT4EJ4BHRbcIY5vyvaqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GTCjZDybFDbs4Pek+rs+GJaYZraEKMzu0dYhHA3JG0fDj8OkzgWh1vBRF1x5ahcOu Ats82ETnhGJ7HpkMWeBjUvR3j4BgDWmxitP04tNVuu7Q3tEJeoKaKiDoMwZ0+aEcBy iFf/MpP+8atVQAq6c6q39hp1HHCl9UwSzNwjjjQzvz5/cPgpCMJwAyftzu+1jvJ/XP B2Zw/SYVhms4eb7rPilh0OjE1yKAc/3ksJbdFq/g3boKMnW8/G74wccLqzqeZr32ZD awvAtM+VESHU85MRlnf34QBFZTm2hkkNdOFZp/bFjhe0kP18xTkYioL1kPDqics8H6 uVO1o06x/ioeg== 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, kernel@collabora.com Subject: [PATCH v6 25/54] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build Date: Mon, 6 Mar 2023 15:05:14 +0100 Message-Id: <20230306140543.1813621-26-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230306140543.1813621-1-angelogioacchino.delregno@collabora.com> References: <20230306140543.1813621-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?1759629656404609199?= X-GMAIL-MSGID: =?utf-8?q?1759629656404609199?= 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");