Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp172321ybl; Thu, 29 Aug 2019 20:59:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgMnGf9T4RnToWdJEIRy4+bd3nyLOyvMdt9ZTmABOpRHuGzKNk3s+vGRoNn3Kl6giNCfTz X-Received: by 2002:a63:ff65:: with SMTP id s37mr11116247pgk.102.1567137552805; Thu, 29 Aug 2019 20:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567137552; cv=none; d=google.com; s=arc-20160816; b=bxfdw39KdTs7ZL4PZtdr3C7A5Kgki8RbCAPKo3IVEwn2WPtYtgK62yfr93GZFWNvOi 8LMe7jKc1q/jMQKRvDqnCaPKw5iBbfnbSbElTblVgOLhXAqGuBUw7rd5gg1srru6jqGV OJ03hd6M0iqpKr4fERuwdTXfiICf3+ozuXyoC+ow1Q7zGWg3PgcseJvqE7Qi/TfXWoC3 Jdu7TneXuy2s/3QmOlRLYsPvcrlb9/Re8D9WaN15G5Jn5Jl8vfqJDEYcSmbUyxA8ciZL 6biyxKgrcr31AP0U5i+scH9F6ujFoVULUgusypVNeCVEgxDtcCOA6ZPaNyBtkgQAgY3e lnPw== 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=KU4VqnrMRmF6KKCPL5xBacm+7LKAal0HJ9+XLb0ULMLUJZoB5Q4RqA8zYseNboGl+z S6eIwxOuE7Sl4EeJ8l32gOKwW6GHymxGto4C2DlTpGceJrRlEDEG8kzuwWalQimQWpYK Oyl6VFw1l2fualBMQiYLVK449coZh2G66mFvAqb5yvGAsz+6rsbMgg4vUqObRFI5bCG5 ZxUOxpZJ9+hXGIjQg4eGQt9kiQNpraSBL/aKy8W6vScRTYKbxdGyV1vql8MNIKwAugqV NPlp1xCdspXvRWrS+MQopKuZQGrwRbz6sLAoT1sApm8LhVFyxnMYNx/DPIyahwVwEzMF ma2g== 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 b188si4653815pfb.279.2019.08.29.20.58.56; Thu, 29 Aug 2019 20:59:12 -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 S1728178AbfH3D5p (ORCPT + 99 others); Thu, 29 Aug 2019 23:57:45 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:46251 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727066AbfH3D5o (ORCPT ); Thu, 29 Aug 2019 23:57:44 -0400 X-UUID: e8f93519f6474ada95b3e2f008098ac5-20190830 X-UUID: e8f93519f6474ada95b3e2f008098ac5-20190830 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 326418559; Fri, 30 Aug 2019 11:57:40 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 30 Aug 2019 11:57:44 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 30 Aug 2019 11:57:44 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , Sam Shih Subject: [PATCH v7 02/11] pwm: mediatek: droping the check for of_device_get_match_data Date: Fri, 30 Aug 2019 11:57:08 +0800 Message-ID: <1567137437-10041-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1567137437-10041-1-git-send-email-sam.shih@mediatek.com> References: <1567137437-10041-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