Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1892843ybn; Thu, 26 Sep 2019 03:55:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvmxtFosf2Sar2FsY5PZ5cM68JAf3bkSURGjbPb6UcCcSpgnFsJfgYIiPpB2Qj2YPsxbGa X-Received: by 2002:a50:95a3:: with SMTP id w32mr2785870eda.211.1569495318574; Thu, 26 Sep 2019 03:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569495318; cv=none; d=google.com; s=arc-20160816; b=bPy3EFxylhiS+tsAuyrAyFq3OHlrdhOTwWeZaw9QhBCzmOV7EVlB7YaMLu6qCYlHy2 DKJaSNfFdjcLKykMddfer6klSD9SLWonoFYTjhAWlD866A+I1qpUbkO7xmPgZPekd1XL Et17h1itQ/yxmg1P+pZ880CtEIBKNP0uaCzpGxuIdxx1PB2tFzoMVl0OAM7p80x05ygu EnNOfuSdDf8CkpGTsUVNDJ0k7ddU7FeMpg8ATi+0u6LzNavAaWoqUe5Rd7BVy82fEHSA iDMh36LIehYA9Cmbkj7EKXrp02Ws/mcNassaYI75AXlUsXfeStmQV4eEJ2aPCBG+qimW sPHA== 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=zS8HLY+7ocLxQ2wvJhfbge+JhtoywpCT572itZNxdpN6sCgJBEQEnfE9xvkOdRSrwW VZ6Ge4ajxmVRYkdF8YU1RAjCwLkoXoMnnnCwhshEB4pd4cOg2bX92kbDktZi8+CRtv1h 1afCwgp6aZKs/uGLxkiJwd12PmgriDOOMzNW2OfqdLgf3GjJi7scL40OyZK7U1eijUw+ +BEQz2oM2WJmc3UspyF2GcDnPmCnI+9EzkPLrBCSdrUofx9EY4IW9gIxUskXwY5joyCA 41wlTyjRBlxvu6KLgVu6+qSfsDiWddqjkOizuU7qJq5y+qgR6CY1067dVombpwt8geuF k0bw== 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 k2si1072983ede.311.2019.09.26.03.54.55; Thu, 26 Sep 2019 03:55:18 -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 S2407433AbfIYOdb (ORCPT + 99 others); Wed, 25 Sep 2019 10:33:31 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:37178 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726124AbfIYOdb (ORCPT ); Wed, 25 Sep 2019 10:33:31 -0400 X-UUID: 8bfcb3d7bf9344f29b67270c57c156b4-20190925 X-UUID: 8bfcb3d7bf9344f29b67270c57c156b4-20190925 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 841055450; Wed, 25 Sep 2019 22:33:27 +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; Wed, 25 Sep 2019 22:33:25 +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; Wed, 25 Sep 2019 22:33:26 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , Sam Shih Subject: [PATCH v10 02/12] pwm: mediatek: droping the check for of_device_get_match_data Date: Wed, 25 Sep 2019 22:32:27 +0800 Message-ID: <1569421957-20765-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1569421957-20765-1-git-send-email-sam.shih@mediatek.com> References: <1569421957-20765-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