Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4292587pxf; Tue, 6 Apr 2021 12:40:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp69pF+oSzRhrPRT/LknTBTQt6FCwUT3/c4I3U9+TTRDEkCmKwcNqKMVVx16sG7h4phe2V X-Received: by 2002:a17:906:3385:: with SMTP id v5mr36063203eja.539.1617738008586; Tue, 06 Apr 2021 12:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617738008; cv=none; d=google.com; s=arc-20160816; b=QV/QzIFlyAqzAeAoYolIRbA3LBT2ow4d+UfD3mx/+IrSyfymzYRgMjPwHA7AcPAWG9 3irRGkC/8Z0TGEIxip986vV/w95z7SaXQOZMiP6SSVk6l6fpGd07DbxMTylo0wtVaqxX yr3jI51ky4eegkNfXFsthRI1JILGpEmj5lNFz0lp5DlA6AkHPo4Xe5Bske08FNDPe1TX 44IxS46yQG17lcdhmG5txOINx4E0cMauc1V7Nlgy37uijcWeW0wIptNRQ7/wZ1wqpodS 4hlPKcczcEjwQLmBdOLZ1QeYDXEVdBDgc0jsm4JI86/IU8Qk67w+dStyruxXiiD9IDQd XADQ== 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; bh=3XX3zetqFxHeOJrnZ4ZZ0xiOMZ2hLI9tA6Z5gp0AY00=; b=JMcikccREhTXedqJEgPIC8l9j5T6GVETX7TeBzgxYs8p+5LAbr+B3aC8vQ/2SD8zPB FSIg4Z6N+ud9mb28+a6qxYEJ3dq3wWIhIln7WQADRGO2nLfhVhVsmF9AzpNzIrpGGU9X 3KtxzGBhjzYcQDAAZgF7EecbAATU4uqEr/bg/9CsYBynSQ1TtBKJDiSQSUh4KjdMRgg6 /hlEXlU1i0+4zzJ+9fqS1X+7Bt+KmTo05jhuRwu8Ct04M+ZW2RzJJWXiVzzN6+Q/osQC 35bi8nBsDxqtYz4tAvCFVIvf0hd9dQ7uKqYY1EWVbck17x9nTXhniYr3C8Ww2PGJmxU5 eSCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc43si21065058ejc.387.2021.04.06.12.39.12; Tue, 06 Apr 2021 12:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241179AbhDFJ7C (ORCPT + 99 others); Tue, 6 Apr 2021 05:59:02 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:46122 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235467AbhDFJ7B (ORCPT ); Tue, 6 Apr 2021 05:59:01 -0400 X-UUID: d7872b6fb6554129a22c0cc13b11a373-20210406 X-UUID: d7872b6fb6554129a22c0cc13b11a373-20210406 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1840545353; Tue, 06 Apr 2021 17:58:51 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 6 Apr 2021 17:58:49 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 6 Apr 2021 17:58:49 +0800 From: Rex-BC Chen To: , , , CC: , , , , , Rex-BC Chen , Jitao Shi Subject: [v3,PATCH 1/3] pwm: mtk_disp: clear the clock operations Date: Tue, 6 Apr 2021 17:57:40 +0800 Message-ID: <1617703062-4251-2-git-send-email-rex-bc.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1617703062-4251-1-git-send-email-rex-bc.chen@mediatek.com> References: <1617703062-4251-1-git-send-email-rex-bc.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the clk_prepare from mtk_disp_pwm_probe. Remove the clk_unprepare from mtk_disp_pwm_remove. After using atomic API and get_state() function which are implemented in PATCH [2/3], [3/3], clk_prepare/clk_unprepare are useless in probe/remove function. So we remove clk_prepare/clk_unprepare in probe/remove fuinction. Signed-off-by: Rex-BC Chen Signed-off-by: Jitao Shi --- drivers/pwm/pwm-mtk-disp.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c index 87c6b4bc5d43..21416a8b6b47 100644 --- a/drivers/pwm/pwm-mtk-disp.c +++ b/drivers/pwm/pwm-mtk-disp.c @@ -192,14 +192,6 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev) if (IS_ERR(mdp->clk_mm)) return PTR_ERR(mdp->clk_mm); - ret = clk_prepare(mdp->clk_main); - if (ret < 0) - return ret; - - ret = clk_prepare(mdp->clk_mm); - if (ret < 0) - goto disable_clk_main; - mdp->chip.dev = &pdev->dev; mdp->chip.ops = &mtk_disp_pwm_ops; mdp->chip.base = -1; @@ -208,7 +200,7 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev) ret = pwmchip_add(&mdp->chip); if (ret < 0) { dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); - goto disable_clk_mm; + return ret; } platform_set_drvdata(pdev, mdp); @@ -227,24 +219,13 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev) } return 0; - -disable_clk_mm: - clk_unprepare(mdp->clk_mm); -disable_clk_main: - clk_unprepare(mdp->clk_main); - return ret; } static int mtk_disp_pwm_remove(struct platform_device *pdev) { struct mtk_disp_pwm *mdp = platform_get_drvdata(pdev); - int ret; - - ret = pwmchip_remove(&mdp->chip); - clk_unprepare(mdp->clk_mm); - clk_unprepare(mdp->clk_main); - return ret; + return pwmchip_remove(&mdp->chip); } static const struct mtk_pwm_data mt2701_pwm_data = { -- 2.18.0