Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9026220rwl; Tue, 10 Jan 2023 23:59:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtojIM94SC7RWbQbc7yhWY6dM6jTmsfgdHfcOI0eSfVyooobNt/j9Jw+BRQnSq50Ar2gtXs X-Received: by 2002:a17:906:60cd:b0:845:bb21:f638 with SMTP id f13-20020a17090660cd00b00845bb21f638mr56332422ejk.75.1673423999753; Tue, 10 Jan 2023 23:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673423999; cv=none; d=google.com; s=arc-20160816; b=VK6kmOBgwDkfNGeDKp1MGEHGLBG/hn91hY21lSiwvqoFwvhn1UcRbIyN56DkHA5kzP YjAKjmiVGBmwEsr8i1esP3BecN8Gv/3EIJGMqxsKQe1BQ15sT0PQ/VjkgPW4RuTiJvZ7 6AXwRkvaFMXOJ9rKR7gZwHzP+zaBMtTdFGuj+k9JasAqjDvD0ZQ6anqCYqjNl/kblM/w aB1rh6GKOYE8tkGNBXfMtgWLRFAf57urFt0BB1nnbFVNSTAcWBiZzbs8CcMBcoirfua3 SdAs3kZNKfPr093xIy22M30K2bex6VLNWJLbxSlRbvzlDVkhtimpjWdsrNKFNR4qg9eb 1k9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t7GE4jlQlN3+ar5Gqg8Y3m16Njg/s9VQt5fSavqYdJ0=; b=NdoMvpzBRL5VP1gyqR0MKuqjmJNqMqNLtu4l4qyUBJelvCUTocYxdvRMGdgKPscxpM dpWTCcyHzYPYKZ1tVBsWjxGaLmac1HO4NJKSe3sKhqOSLvsxyB4HhZ72TVNeyIT67PJM kGkYsR7QTBFHeD1z0QNradgdkdwM8fz6LpZLLZM4h3dqGMpsbWqsRbJezQQiJVS6obhH DpfAyYOF1iMJ62hayEij3T6ZPMIDuDFJnDg4cBrpMlBQ4b3wmmJOaP62jpUIFdosB6Dk 28xVJPuAx0557m6XINKeFYbg46dEspFIQwZV6s+Q7ajNWAUb9NA26N9PQh7NeaC4iw1n TwYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rdwdZpIq; 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=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g25-20020a170906595900b0084c46478993si11293513ejr.775.2023.01.10.23.59.47; Tue, 10 Jan 2023 23:59:59 -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=@mediatek.com header.s=dk header.b=rdwdZpIq; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236310AbjAKHqg (ORCPT + 53 others); Wed, 11 Jan 2023 02:46:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235539AbjAKHpq (ORCPT ); Wed, 11 Jan 2023 02:45:46 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12F2C1182D; Tue, 10 Jan 2023 23:45:41 -0800 (PST) X-UUID: ed52f886918311eda06fc9ecc4dadd91-20230111 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=t7GE4jlQlN3+ar5Gqg8Y3m16Njg/s9VQt5fSavqYdJ0=; b=rdwdZpIqRtOExTjMA03e8PZZzpKaA2C09YC/ddEuxxzOlo34rc8RmoTwZRpjj4A6byyX16NCfQiZzQXu/Ktoj5ND6Hjtocntb6Z+bVKDOkeIuBE8a3bDR181V7AWnLlLA3zvlMNLNpIVXfBA96oFWaH06feDHwuZFMMqhLPWzbU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17,REQID:2df79e44-6650-40ce-a13e-30ffcad3c862,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.17,REQID:2df79e44-6650-40ce-a13e-30ffcad3c862,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:543e81c,CLOUDID:ce99ee8b-8530-4eff-9f77-222cf6e2895b,B ulkID:2301111545344SMVVLJN,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0 X-CID-APTURL: Status:success,Category:nil,Trust:0,Unknown:0,Malicious:0 X-CID-BVR: 0 X-UUID: ed52f886918311eda06fc9ecc4dadd91-20230111 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 172593089; Wed, 11 Jan 2023 15:45:32 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 11 Jan 2023 15:45:31 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 11 Jan 2023 15:45:31 +0800 From: Roger Lu To: Matthias Brugger , Enric Balletbo Serra , Kevin Hilman , Nicolas Boichat CC: Fan Chen , Roger Lu , Jia-wei Chang , , , , , , Subject: [PATCH v4 11/14] soc: mediatek: mtk-svs: delete superfluous platform data entries Date: Wed, 11 Jan 2023 15:45:25 +0800 Message-ID: <20230111074528.29354-12-roger.lu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230111074528.29354-1-roger.lu@mediatek.com> References: <20230111074528.29354-1-roger.lu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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 From: Matthias Brugger The platform name and efuse parsing function pointer are only used while probing the device. Use them from the svs_platform_data struct instead. Signed-off-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Roger Lu --- drivers/soc/mediatek/mtk-svs.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 9d9210c22289..bd23d1111d7b 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -313,14 +313,12 @@ static const u32 svs_regs_v2[] = { /** * struct svs_platform - svs platform control - * @name: svs platform name * @base: svs platform register base * @dev: svs platform device * @main_clk: main clock for svs bank * @pbank: svs bank pointer needing to be protected by spin_lock section * @banks: svs banks that svs platform supports * @rst: svs platform reset control - * @efuse_parsing: svs platform efuse parsing function pointer * @efuse_max: total number of svs efuse * @tefuse_max: total number of thermal efuse * @regs: svs platform registers map @@ -330,14 +328,12 @@ static const u32 svs_regs_v2[] = { * @clk_cnt: clock count shows the clk enable/disable times by svs driver */ struct svs_platform { - char *name; void __iomem *base; struct device *dev; struct clk *main_clk; struct svs_bank *pbank; struct svs_bank *banks; struct reset_control *rst; - bool (*efuse_parsing)(struct svs_platform *svsp); size_t efuse_max; size_t tefuse_max; const u32 *regs; @@ -2066,7 +2062,7 @@ static bool svs_is_efuse_data_correct(struct svs_platform *svsp) svsp->efuse_max /= sizeof(u32); nvmem_cell_put(cell); - return svsp->efuse_parsing(svsp); + return true; } static struct device *svs_get_subsys_device(struct svs_platform *svsp, @@ -2400,9 +2396,7 @@ static int svs_probe(struct platform_device *pdev) return -ENOMEM; svsp->dev = &pdev->dev; - svsp->name = svsp_data->name; svsp->banks = svsp_data->banks; - svsp->efuse_parsing = svsp_data->efuse_parsing; svsp->regs = svsp_data->regs; svsp->bank_max = svsp_data->bank_max; @@ -2413,6 +2407,12 @@ static int svs_probe(struct platform_device *pdev) if (!svs_is_efuse_data_correct(svsp)) { dev_notice(svsp->dev, "efuse data isn't correct\n"); ret = -EPERM; + goto svs_probe_free_efuse; + } + + if (!svsp_data->efuse_parsing(svsp)) { + dev_err(svsp->dev, "efuse data parsing failed\n"); + ret = -EPERM; goto svs_probe_free_resource; } @@ -2448,7 +2448,7 @@ static int svs_probe(struct platform_device *pdev) } ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr, - IRQF_ONESHOT, svsp->name, svsp); + IRQF_ONESHOT, svsp_data->name, svsp); if (ret) { dev_err(svsp->dev, "register irq(%d) failed: %d\n", svsp_irq, ret); @@ -2478,11 +2478,13 @@ static int svs_probe(struct platform_device *pdev) svs_clk_disable(svsp); svs_probe_free_resource: - if (!IS_ERR_OR_NULL(svsp->efuse)) - kfree(svsp->efuse); if (!IS_ERR_OR_NULL(svsp->tefuse)) kfree(svsp->tefuse); +svs_probe_free_efuse: + if (!IS_ERR_OR_NULL(svsp->efuse)) + kfree(svsp->efuse); + return ret; } -- 2.18.0