Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4812058imu; Mon, 12 Nov 2018 18:09:14 -0800 (PST) X-Google-Smtp-Source: AJdET5dU0iD46jzP1EU8+5XetVfoLdZXYeFzsRlFhAItTborsSH9KEGrYPdAcMJqOpsYp1R+lV84 X-Received: by 2002:a17:902:6848:: with SMTP id f8mr3124187pln.300.1542074954079; Mon, 12 Nov 2018 18:09:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542074954; cv=none; d=google.com; s=arc-20160816; b=uQ7H7NGj2ZYYLTr/GLmG+dx/QyHrMss7fsvg1WLzZi7LWj8G8OCZi0NmYFqVs/pASi GVHOaEISb6qEQrHI+AsHSmpl05cJe89PUcv3rWw+wE3DZNsE1i+JezcKHeSpAuRLbkiD J3uxGDCKfPBw2W9M50JovRYR64cYehYxNRvZ3ntlZb5uvJ+TkXhlD16Lzh7djG+/gXGv BkcWgSDtxK9P4+5lpZmU0g6uBG0Yp4bfWsACRR+7N5xz1vrzKIha5t5Q1wbeFop122Gf 6ORjx/AQTd0dWHxwBUKXdX1x9AxWabtVRVZqTUmoec1An1JyBo7SZ+U7f7xBG9sOpmVS Qg4Q== 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=jR6hPJtgD1eHEg9a0/i2aerfqHOqI7P77Bz4gnQKDuA5hCD5YpOq3HJX4k6O6ziyU9 Z2+mPIrVhmooZ8U00nqb+sxCFicHLJzW5iuqDjrPe8ZVKIX4vusJLegGntPjOBaU4Tc+ 5oIgsoSSBvZniv17+cs1tAQRngSHcnTr6aq2vozAVme/eJRtEpHDr6J+kmfxkKVmYRfb pDuNBUZvaDh2nn8jdApq/f0lOgx8U+MbSkBEq2oO7RVORi9aB7KE8eLd/udPfs2eCW9G FpJldWSDoe6Nl338VE7rNIOlAqYY0WBgFDlLrucomGT/lK4R4Ox3PTQowspPG/NW7h8B sBvw== 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 c6-v6si18945918pfi.110.2018.11.12.18.08.59; Mon, 12 Nov 2018 18:09:14 -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 S1730816AbeKMME0 (ORCPT + 99 others); Tue, 13 Nov 2018 07:04:26 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:1603 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726111AbeKMMEZ (ORCPT ); Tue, 13 Nov 2018 07:04:25 -0500 X-UUID: be168bee4ae54edd87c64d665c9304eb-20181113 X-UUID: be168bee4ae54edd87c64d665c9304eb-20181113 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 759635621; Tue, 13 Nov 2018 10:08:25 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 13 Nov 2018 10:08:24 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 13 Nov 2018 10:08:24 +0800 From: Ryder Lee To: Thierry Reding CC: Rob Herring , , Weijie Gao , Roy Luo , , , , , Ryder Lee , John Crispin Subject: [resend PATCH 1/3] pwm: mediatek: drop flag 'has_clks' Date: Tue, 13 Nov 2018 10:08:22 +0800 Message-ID: <4c9044427b1aab373acd6ac76f0c905e2be79784.1542074855.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain 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