Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1828913ybl; Wed, 28 Aug 2019 22:42:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYK4gYkkRWDJC5E6DQgVl3ZaopuXfFlaFeZnYdoKcBjxSdipIk3fnzc52tAiByKj4/S8Lk X-Received: by 2002:aa7:8c4c:: with SMTP id e12mr9203828pfd.258.1567057362986; Wed, 28 Aug 2019 22:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567057362; cv=none; d=google.com; s=arc-20160816; b=USzR8S2OQewBsjCXpv4GPNL1bpiloeRg+bJtwZLY34SzSq8UIJpzZ+Ri1lQ+XHV1Rn yF3hfBaofVlS9tbowsmjW59v9LcFYdtuJYpSeaF8tojQPhfmMU2JXk6N9bWFensX1os6 IJz3pb3zMENZ/eIJ+gJZUof1cT2sHKkBuYf6t8R7O050VpUNaG+igWh7i5FBFEU5fbHD 0+BC7VLGWVTk0yKFTAoDczK9v54ayQfiQHEgR3WcWsjzPVM12JdMcfRSwH+8hNGn14vO nLSYzvne/sVO8BmI/7myK55FoLhIWBNljDhge0rqskEQT+enmAZYtVfn/X+0dIPU6rGm isSQ== 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=eiQz0JbFvplqOdxUGnhaSNXCT6q08IauWx74X7lqy8my2bgBqxKeOKGFExIWbi8yNw Zb7LQ0sbJ7OoN6jW6hFaWphJPDz+oC0Dd22fFD/o9EJpTTNgg9ocAVhO+usnpi8JeGbT GI4o7jiWgAha3qtQJ0V3+kgm0zHvfQT8UJ6cDKWBaC8uaUBj2zewWQzCx4GPyg6cLocL Y/f2sRyDd7W9E1dYWh77JGUejW9gABU4djiuJUcnpaIE5XiIvDgyWfkubQIWmvxkdygG OZkOY+aqIxBzOEnyo0XUSM9CFe2huhARWMo1c9FE6O+M1GamoPQ73s3vgZECnz6mSZbq i/cw== 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 j16si1431651pfh.0.2019.08.28.22.42.27; Wed, 28 Aug 2019 22:42:42 -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 S1727474AbfH2FlX (ORCPT + 99 others); Thu, 29 Aug 2019 01:41:23 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:53779 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbfH2FlX (ORCPT ); Thu, 29 Aug 2019 01:41:23 -0400 X-UUID: 2b0b53f2a43a47f9ad7f36ec424c86f7-20190829 X-UUID: 2b0b53f2a43a47f9ad7f36ec424c86f7-20190829 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 134772842; Thu, 29 Aug 2019 13:41:16 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 29 Aug 2019 13:41:21 +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, 29 Aug 2019 13:41:21 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , Sam Shih Subject: [PATCH v6 02/11] pwm: mediatek: droping the check for of_device_get_match_data Date: Thu, 29 Aug 2019 13:39:11 +0800 Message-ID: <1567057160-552-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1567057160-552-1-git-send-email-sam.shih@mediatek.com> References: <1567057160-552-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