From patchwork Mon Mar 6 14:04:58 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: 64682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1866485wrd; Mon, 6 Mar 2023 06:18:34 -0800 (PST) X-Google-Smtp-Source: AK7set+PjW5w8RGrkKyyppG8n/VtXiDawAr/P+Jj/ARv36YckjE6JcfCgJFBUZhRBkANDi8e2COz X-Received: by 2002:a17:907:1c15:b0:8af:2fa1:2226 with SMTP id nc21-20020a1709071c1500b008af2fa12226mr14080189ejc.6.1678112314473; Mon, 06 Mar 2023 06:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678112314; cv=none; d=google.com; s=arc-20160816; b=DFMbwvpR0TY50xr4WkkLkZHxC2fb0wDCcqKbdW83F/y3DNubVbJsV6qb7KbCTh2RVp /LBwhtkiIa8FvBkAIOslPqzloVn/+V5MBj1B4Bol4X/NpfXZWtuk0nsFZPTInmikSDu1 ie4NUygho2N3tStAEs5SjnHQqSGdrZGaMlAW4wcA+YUjyXIPMkuh2R1ecWWqNcuQcEws Oyg6R71Oge24Ze0tj/Q8idVuZIWkTdwUIfstAcdbBnr9v/ibZ0BQVmrPkdqmIcLAi5Fx 2E6eCd2vEjfGiSN7c8zOHov/pVcIABEa5J2CY9n9NEr7VHtXfFFN1JRc2BaMhHfT4oqY Mgag== 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=8MvGISZkN55EMPWuuJdXCWFCtP9jqMvtgeY0ONo0qQ8=; b=c7cchoMiRTBfpI26d0mCQRcUJuMtDS2FbkQU+d30L7N4g4pEoZcvpG8eeJy8jy7+xe DpsoH/HIqZwIl+nZqM8BZ5vziOf3n6a3DcDXlSvUxaeA9V0Q3Kz7g0DHLIuQ3lKyoWrV AH6bkTGZR+LRhFgix9d5bMCJjcVRJtYdwVwjdAwrwBLKZkoE5T3lrTtRN3wj7/c1LnuH lT76v/G7Xg/0k341tY35bTaiiHcIxZoBtxGn92DkYFoKtW/P32/qxO9WWs9Be8pgicuI FgcBEk1f6G+P0R5abaquNaAn0oX7YvVDVfa9e5aT6un4YX6gmwTGV6DeddQUbeKgBBRB l+xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hRRik9yh; 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 um16-20020a170906cf9000b008c72577b130si9598106ejb.636.2023.03.06.06.18.10; Mon, 06 Mar 2023 06:18:34 -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=hRRik9yh; 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 S231150AbjCFOHl (ORCPT + 99 others); Mon, 6 Mar 2023 09:07:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjCFOHR (ORCPT ); Mon, 6 Mar 2023 09:07:17 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E2630B02; Mon, 6 Mar 2023 06:06:50 -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 50DC16602F6A; Mon, 6 Mar 2023 14:06:01 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678111562; bh=c06sztOuI8DQ5DDjj8gCYxk1bqozhA9LrG1lTO5UoY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hRRik9yhPavOoET28fPMy3EQmRsCtZmw2t4i7xc1ws4b9JPXUQfzBmiTd4pPevYNj FIzRdLTLjPG1qUCchXNy9pwpbpNzpNisDDHUkbpRsPg6cjQi06gmcFiC1cWhaTtqU5 YUBB5l675xjYbCRUQtv3qLp7eDXzAYS/1pp9k2Bptg/HcxW8fAXBUgSV6qmXAACSyj GRiINnS3AhoQxC5zZ7LaRM5O6xNpSQK7V7Hdf9gben6Gb6pt9bo+ypY/93b7q696ly WLDImDWGk9GhKdl9WEFGgGkWrHeHk1cKXhtkHvDb774yhyVMdNhbXi79vIpcgLjVmU HJKfdUMXfHIYw== 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 09/54] clk: mediatek: mt2712-apmixedsys: Add .remove() callback for module build Date: Mon, 6 Mar 2023 15:04:58 +0100 Message-Id: <20230306140543.1813621-10-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?1759628298441626186?= X-GMAIL-MSGID: =?utf-8?q?1759628298441626186?= 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-mt2712-apmixedsys.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/clk/mediatek/clk-mt2712-apmixedsys.c b/drivers/clk/mediatek/clk-mt2712-apmixedsys.c index 1e1a8272a4ac..2f4061c9a59e 100644 --- a/drivers/clk/mediatek/clk-mt2712-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt2712-apmixedsys.c @@ -138,6 +138,18 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev) return r; } +static int clk_mt2712_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_plls(plls, ARRAY_SIZE(plls), clk_data); + mtk_free_clk_data(clk_data); + + return 0; +} + static const struct of_device_id of_match_clk_mt2712_apmixed[] = { { .compatible = "mediatek,mt2712-apmixedsys" }, { /* sentinel */ } @@ -145,9 +157,10 @@ static const struct of_device_id of_match_clk_mt2712_apmixed[] = { static struct platform_driver clk_mt2712_apmixed_drv = { .probe = clk_mt2712_apmixed_probe, + .remove = clk_mt2712_apmixed_remove, .driver = { .name = "clk-mt2712-apmixed", .of_match_table = of_match_clk_mt2712_apmixed, }, }; -builtin_platform_driver(clk_mt2712_apmixed_drv) +module_platform_driver(clk_mt2712_apmixed_drv)