Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp517179ybl; Thu, 22 Aug 2019 00:15:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwy9oFMp8fIUeOn6C2sw9OnoCNyKXF2jgpFTL+USrWtT5Gn4w5a4BRZYofV70ZrCsD2Gi3o X-Received: by 2002:a17:90b:f12:: with SMTP id br18mr3727994pjb.127.1566458135527; Thu, 22 Aug 2019 00:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566458135; cv=none; d=google.com; s=arc-20160816; b=ueXIs4vUzUtsJoWl4ybdghuBtzY7Z1IN37/KGyB4GoRnqAhPzsx75XhuDOTr2ZI/vR SIG/UIcIjqdPLASWNGMHGiLF6aZmyLCUVbyRRf6nQI+/D7kqnxckIf0YzkO1YelY7fSN XOfz640bfBl3fuocLWqzQoqIPHdlvc03nsSjyYp9m0u58hQ9aMgcUG1W+GzmMmD9sDn3 AVzD8AdnkD0ZQ263PkOULc7jxlT8pzqSsCJzDHFmIDVka/COVB06YI0TMBSYzfmnGdLG TTIeONq7jELAKB15fwTWZa3HMeSjcaIJXnWlNvK+kjcXfKDRcB9Z/PDf4WK45XAYHtsO escQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=KvZPE4IOHdgy2xaqGKZExjjc9Mvlp536uuwTUBuxBZo=; b=xBxKzMqoETvbb8zEBgCUJ9zeq2rPoWXwXDwtsSulWeR5IYfyXslLtT/G9Yn1/yAr4C fEpeCr8uSKaCaO9llpUPAlta3FE0UZpENiEgIGMl3Me4rZsRrymMz5ZPZNvQo+I8oCyj I1SoZJueItTnH3E8IP9dwLEzdVCVYyU+t6H8qAO1yg9xGnSLePvkLr50Gmu28agQ+Jgp ev/FMI8hbKnf9y0zXFSJ2Meq47sJQhsR1EcmsASTYButv3XTGYG/5Fi9VpnK8fikgb+G tPeyEBpf0vU8FtgxIJ5pIPpzlda1YuSQFe0tZA76IxAR5f6eIF0nHSfxSYmuGFOXoSeD 3sMA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l35si17052625plb.322.2019.08.22.00.15.21; Thu, 22 Aug 2019 00:15:35 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731925AbfHVHA0 (ORCPT + 99 others); Thu, 22 Aug 2019 03:00:26 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:27207 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728605AbfHVHA0 (ORCPT ); Thu, 22 Aug 2019 03:00:26 -0400 X-UUID: b702d273852648b3ad3c60f7b35ead3e-20190822 X-UUID: b702d273852648b3ad3c60f7b35ead3e-20190822 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 332468386; Thu, 22 Aug 2019 15:00:19 +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; Thu, 22 Aug 2019 15:00:17 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 22 Aug 2019 15:00:13 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , Sam Shih Subject: [PATCH v5 02/13] pwm: mediatek: droping the check for of_device_get_match_data Date: Thu, 22 Aug 2019 14:58:32 +0800 Message-ID: <1566457123-20791-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566457123-20791-1-git-send-email-sam.shih@mediatek.com> References: <1566457123-20791-1-git-send-email-sam.shih@mediatek.com> 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 This patch drop the check for of_device_get_match_data. Due to the only way call driver probe is compatible match. The .data pointer which point to the SoC specify data is directly set by driver, and it should not be NULL in our case. We can safety remove the check for of_device_get_match_data. Signed-off-by: Ryder Lee Signed-off-by: Sam Shih --- Used: https://patchwork.kernel.org/patch/11096905/ Changes since v4: Follow reviewer's comments: Move the changes of droping the check for of_device_get_match_data returning non-NULL to this patch Change-Id: Ibcba903d5b26159051adfc5ef2e601ee2f78729b --- drivers/pwm/pwm-mediatek.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c index e214f4f57107..ebd62629e3fe 100644 --- a/drivers/pwm/pwm-mediatek.c +++ b/drivers/pwm/pwm-mediatek.c @@ -226,7 +226,6 @@ static const struct pwm_ops mtk_pwm_ops = { static int mtk_pwm_probe(struct platform_device *pdev) { - const struct mtk_pwm_platform_data *data; struct device_node *np = pdev->dev.of_node; struct mtk_pwm_chip *pc; struct resource *res; @@ -237,10 +236,7 @@ static int mtk_pwm_probe(struct platform_device *pdev) if (!pc) return -ENOMEM; - data = of_device_get_match_data(&pdev->dev); - if (data == NULL) - return -EINVAL; - pc->soc = data; + pc->soc = of_device_get_match_data(&pdev->dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pc->regs = devm_ioremap_resource(&pdev->dev, res); -- 2.17.1