Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3772585imu; Sun, 11 Nov 2018 23:35:11 -0800 (PST) X-Google-Smtp-Source: AJdET5c6m7gug3H1Doklu8J3jfVjBeM6CMLOV8mLehfNDtFJ4DUJsimL9MdtLv8JoGj39v4+2+QI X-Received: by 2002:a17:902:bd96:: with SMTP id q22-v6mr6712654pls.167.1542008110979; Sun, 11 Nov 2018 23:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542008110; cv=none; d=google.com; s=arc-20160816; b=w2cYf3/An+8zxlDPwSLgzO1i6x/OlZB3b5SIGVpTBKKm4pl2naqMLfiv2KphQWDxra rZbylW7s022yzPybDZ3XqKeOYTxVHrJjjyCNtu9aY/dFlXLu8MMXl0bZmshlavFCOzaL R1rgEi8oVxKQiK4+mQr/8CbCm9RCeosLksmXulY1Xmw83W7S+lBsCa77HmwE/Lzkv9fd /lnUpE8T8yv6ZzoB+zEG+gwg+/rr8gYbZV0IkpQNrvbHoQmXxoVNQs2WKOHBoS/Axk/7 ytc4x/XeL/zixyVVvaNC6qX0wZ+5aLNhGGyIbgX5yFQsOWpZuQ0ruMZ9Uj0afJ4B5/01 O/jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=bCjXENVTVZeMCgV8j7+juzdLPBVqdx102eVV8jv8o1c=; b=hwue+Rkw9OdoiSLE/3/H/CysVn66Y8qoKJpDFJoQHwQhPWL8aH16E78FlzarD6NgxN zcHyMd8GEfIe+L99ERLuNvJK/gfnhiVJC4t4eBH36ocM00CN1bNnDMpwe5L6+/2fjXgE iAHco8t58b9wnuW95W1rnq/jnXwarNVyCC3d0njSD4aPpjlE6cFQLXYx58x8a9jON73z Tn9uUHcJ5t/T/Nm3nlBfTnrIGQE2SVYtAKkOV2RfADOdHWZXi5lRQPWkW/v5bAF9IbU4 sj+Vb43nrK3Beg6/EssdLNEZg5fdbdqB5V2LjWw4PBPlS0oY/zhvdqqFalQbewNUmFuJ YOnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38si16088037pgx.460.2018.11.11.23.34.56; Sun, 11 Nov 2018 23:35:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbeKLR01 (ORCPT + 99 others); Mon, 12 Nov 2018 12:26:27 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:16495 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726971AbeKLR00 (ORCPT ); Mon, 12 Nov 2018 12:26:26 -0500 X-UUID: 96b39717492f48c88fa6820196486667-20181112 X-UUID: 96b39717492f48c88fa6820196486667-20181112 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1053846219; Mon, 12 Nov 2018 15:34:01 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 12 Nov 2018 15:33:58 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 12 Nov 2018 15:33:58 +0800 From: Ryder Lee To: Thierry Reding CC: Rob Herring , , Weijie Gao , Roy Luo , , , , , Ryder Lee , John Crispin Subject: [PATCH v1 1/3] pwm: mediatek: drop flag 'has_clks' Date: Mon, 12 Nov 2018 15:33:55 +0800 Message-ID: <4c9044427b1aab373acd6ac76f0c905e2be79784.1542007642.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 9CC1BC1682D59B70097A40A4036CFB37126FE60CAC2EC16B44782C046213A3A72000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The flag 'has_clks' and related checks are superfluous as the CCF subsystem does this for you. Cc: John Crispin Signed-off-by: Ryder Lee --- drivers/pwm/pwm-mediatek.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c index eb6674c..9400c41 100644 --- a/drivers/pwm/pwm-mediatek.c +++ b/drivers/pwm/pwm-mediatek.c @@ -57,7 +57,6 @@ enum { struct mtk_pwm_platform_data { unsigned int num_pwms; bool pwm45_fixup; - bool has_clks; }; /** @@ -87,9 +86,6 @@ static int mtk_pwm_clk_enable(struct pwm_chip *chip, struct pwm_device *pwm) struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip); int ret; - if (!pc->soc->has_clks) - return 0; - ret = clk_prepare_enable(pc->clks[MTK_CLK_TOP]); if (ret < 0) return ret; @@ -116,9 +112,6 @@ static void mtk_pwm_clk_disable(struct pwm_chip *chip, struct pwm_device *pwm) { struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip); - if (!pc->soc->has_clks) - return; - clk_disable_unprepare(pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]); clk_disable_unprepare(pc->clks[MTK_CLK_MAIN]); clk_disable_unprepare(pc->clks[MTK_CLK_TOP]); @@ -246,12 +239,13 @@ static int mtk_pwm_probe(struct platform_device *pdev) if (IS_ERR(pc->regs)) return PTR_ERR(pc->regs); - for (i = 0; i < data->num_pwms + 2 && pc->soc->has_clks; i++) { + for (i = 0; i < data->num_pwms + 2; i++) { pc->clks[i] = devm_clk_get(&pdev->dev, mtk_pwm_clk_name[i]); if (IS_ERR(pc->clks[i])) { - dev_err(&pdev->dev, "clock: %s fail: %ld\n", - mtk_pwm_clk_name[i], PTR_ERR(pc->clks[i])); - return PTR_ERR(pc->clks[i]); + if (PTR_ERR(pc->clks[i]) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + pc->clks[i] = NULL; } } @@ -281,25 +275,21 @@ static int mtk_pwm_remove(struct platform_device *pdev) static const struct mtk_pwm_platform_data mt2712_pwm_data = { .num_pwms = 8, .pwm45_fixup = false, - .has_clks = true, }; static const struct mtk_pwm_platform_data mt7622_pwm_data = { .num_pwms = 6, .pwm45_fixup = false, - .has_clks = true, }; static const struct mtk_pwm_platform_data mt7623_pwm_data = { .num_pwms = 5, .pwm45_fixup = true, - .has_clks = true, }; static const struct mtk_pwm_platform_data mt7628_pwm_data = { .num_pwms = 4, .pwm45_fixup = true, - .has_clks = false, }; static const struct of_device_id mtk_pwm_of_match[] = { -- 1.9.1