Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6229256ybe; Tue, 17 Sep 2019 23:23:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzahrbvOQUZzHzLtc55kcwp0F7yiRKdoZKrKigFcXvCf4sNQKpULNKURz3AA2A1Bju7g4RC X-Received: by 2002:a05:6402:a4b:: with SMTP id bt11mr6282443edb.175.1568787835530; Tue, 17 Sep 2019 23:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568787835; cv=none; d=google.com; s=arc-20160816; b=cPeD1ryCjrupeY1V4s87BcdqSKqk3BwYnwmk+rTL+VdrcPUTcXtmBdJc/2SIVmn22i +I2DgDHO46TI+GrIs4dT8VAWLwFjleWWPSVn1g1I3CoJrsQQ7MDRWPgayiGmrtT2wVQE 1lG5HTQCIOortu6YGmteI2V7yh900gMHtBLcEt4A1XueA99R3RFvkjE4s6rjFtv4lXYF eyk9CtA8SQK0eN+bPyqRSl3ayg5+U8v2cajN+TKt+5VK+UfNO1yeWRwMZzQpYKj1L0G0 ljSajJAO24yN7hYREiT6FrRqfMMzIWt4BmgNb0EeA16L55OwEAks8nRxlHQGJVDSv5ar TVBQ== 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=wRDYeuu2E1fNsXTmUjYWp+SdvOEdMqmfaGo3RxHUXfB6ZhH4Ol9KPhjU5mjoWvtIh1 oO5D5Y5+64ADr5Fzhu063mapTnPCWYN6RtKOvD9s7Yem2raRAAh9CqJ92GVjHKYqNIJk 2wWniMhGDIw4OI7p5p+Rp5l5tzrfNZZbgxc9I/YZGzD81o+S4QfoA3ZnrozfiPCNWMY4 IzZOCZtA+PPxaDcK7WOO1PWlQh1iNKAVJXechYFpd0hYvlFGL15If86ydIAkLn4xj/xQ hBZljFCnhQ3V463+3/Zjxzene/mcwl1NJzjmAOSeV5MAWDKE81Zcq0vEZKhTbNg/5elX 4XKw== 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 l22si2734040edb.241.2019.09.17.23.23.32; Tue, 17 Sep 2019 23:23:55 -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 S1728051AbfIRFvL (ORCPT + 99 others); Wed, 18 Sep 2019 01:51:11 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:6095 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726676AbfIRFvK (ORCPT ); Wed, 18 Sep 2019 01:51:10 -0400 X-UUID: 6a35232e33c347e7ba811982ce89f964-20190918 X-UUID: 6a35232e33c347e7ba811982ce89f964-20190918 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1824988182; Wed, 18 Sep 2019 13:51:04 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 18 Sep 2019 13:51:00 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 18 Sep 2019 13:51:00 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , Sam Shih Subject: [RESEND, PATCH v7 02/11] pwm: mediatek: droping the check for of_device_get_match_data Date: Wed, 18 Sep 2019 13:50:02 +0800 Message-ID: <1568785811-9577-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1568785811-9577-1-git-send-email-sam.shih@mediatek.com> References: <1568785811-9577-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