Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1674840ybj; Fri, 20 Sep 2019 14:36:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwehvn1BXTq2/8dLiO+Fjx47emacFsHPGbPDydFKg2iq2BN8sbI6BlcEsVO+GUOzSWrcxq X-Received: by 2002:a50:9fce:: with SMTP id c72mr24788350edf.166.1569015405844; Fri, 20 Sep 2019 14:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569015405; cv=none; d=google.com; s=arc-20160816; b=sDLxupEh8SUif997QGxDdhP24lupEjrFjm8Z61vMuRJHEVfMPjbCQjJBlNTrJKW2AK +kldwqeHTII59Ri7ndYS58B/BEfp0nln0VHethe5jljIHzAWqQhhHTPKXul3llo1BcZ4 FhvzuMRPgPppjSb6+6gd3PPDzLAnb4EgBSNW/dIOU+TTsG8FXGZ2JrNamyMMkTbGExli LAJpXUxqwgv6EAMr4aVK7E8seMJlW1VZJZVoU6YJaQBK8KuyiX4vIg+Q3JHo+aN7H2gl qidoWig9YIh6SKGgXv/KRNgFlRKE0wKOlMIZUHJv9D/BZftOlwNDtsqhsmlPo1z6ACHr qqrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7iqGEYmftMMImLKOIsLNWm8HXLv0KVU4EbyeU4CiFbc=; b=iMwLKWCVGWva+IAhb/yM6RP+AqPRV8i3AwmCyV99VzNRjn/RzB7rKF4ONiN9gkf3XP SkYx143yIx9suO0Dko3D7Z9qm9Ctl5nByUPx/n64y9q2QXRCfePwQwx8BIasltOvF3+M OmBe4d9qL1JYGHAsXD2XVE9XG9IbhzsEwkJKQq/WnKpqt1YRtBDZa9wm/ZkjCw+gf0W6 R19txqNLNmiYbsxu8RTI2mvDj2fB58ESEfOc+Tf+q3UUCx1XODpUkR1pGGnRlMxTvRd4 FqPc2pMLYxUXRRD54t64Rgg/oldRTOGWs9kZ6B3E82hr0qi7cREsGLPgWo6Fb/aRHEPn hv5w== 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 5si2338673edy.95.2019.09.20.14.36.20; Fri, 20 Sep 2019 14:36:45 -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 S2405824AbfISWur (ORCPT + 99 others); Thu, 19 Sep 2019 18:50:47 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:58454 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2404705AbfISWur (ORCPT ); Thu, 19 Sep 2019 18:50:47 -0400 X-UUID: 84bc3b745cde4057b8f50c887d41625a-20190920 X-UUID: 84bc3b745cde4057b8f50c887d41625a-20190920 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 572780076; Fri, 20 Sep 2019 06:50:42 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 20 Sep 2019 06:50:36 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 20 Sep 2019 06:50:36 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , Sam Shih Subject: [PATCH v9 02/11] pwm: mediatek: droping the check for of_device_get_match_data Date: Fri, 20 Sep 2019 06:49:02 +0800 Message-ID: <1568933351-8584-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1568933351-8584-1-git-send-email-sam.shih@mediatek.com> References: <1568933351-8584-1-git-send-email-sam.shih@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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 Acked-by: Uwe Kleine-König --- Used: https://patchwork.kernel.org/patch/11096905/ Changes since v6: Add an Acked-by tag 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 --- 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