Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3422900ybl; Mon, 19 Aug 2019 18:42:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqznjqAgCpaU5ZW7Hc4bwy9Ds8AuYZUFEnWyFinjvxa05nGSa5rV+41xwFh9VRJRDcU0HS8k X-Received: by 2002:a17:902:1121:: with SMTP id d30mr19345794pla.174.1566265372723; Mon, 19 Aug 2019 18:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566265372; cv=none; d=google.com; s=arc-20160816; b=M5uq1gzOHIprbvwVk8bSnIpGq5DQQoPz6F4CPnjKwbGnKT8GbGODoBLwcFs2Rr294z SNy2+FWmpTJVCJBP1IKoTYSYhoRid4rY8MCo3DJoVgq3Wm9XdJztmpRFjgHmfnsi0dA/ rCztAJ2y32gLfcP6jqYCVcLETdO3u5aAl5VAmMEhFGOZ9snqd1PyAYVWImS6NLQUuyDj NY9zSgtu69ev+108pzqMycwdocMWEpagGlatLBGdDM9/kWs+eHJ4T1hkwxb4NtKoixz+ YKJ2cBxJsN0KLEeY6pTlHYkJSGaAWfrsR1fxQ8yukkWaZPQMvZ3DVcDMcQgki7m5/YJM d5Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=BSJMZ/1rtH+C1RDuY4TfLieqW/ifIFSNGsFiTwMqaQ0=; b=GnqHo3g1hFeJFgVCeAaGKE1q2jv8PBL3/ktBIfPDj2vwhn+2fnn3MHD9FFkmq3aCkY SLE024OM6njb7GJefIVun7gb6oUmulBjxbBICnb+UeToGcfwG2AIgFoSfrcmpfl63+Qi pBw6gAHj/U3wXQyhKIaJzk6bvKvU7uPZvAJLJ6m53uXiThjiVdN0HWC1NyOMSZ8V1uKF hlNLr+hm/DCAtsMHRZtYJh24xCwPuM63e2uqqcze83BS4WJc/jcSfwj7vZwu4r8PLudJ Zq4bjan0sIHQueQvqP6/TeAgF4SITmzniS8+lu253RXF5FXV4rtsc8haJs+Gz5GmplZO XgVg== 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 94si8657173plc.407.2019.08.19.18.42.37; Mon, 19 Aug 2019 18:42:52 -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 S1728983AbfHTBlo (ORCPT + 99 others); Mon, 19 Aug 2019 21:41:44 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:10618 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728965AbfHTBlo (ORCPT ); Mon, 19 Aug 2019 21:41:44 -0400 X-UUID: 3fefb04ee26c44a0b65ae660e32f6794-20190820 X-UUID: 3fefb04ee26c44a0b65ae660e32f6794-20190820 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 2043514438; Tue, 20 Aug 2019 09:41:37 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 20 Aug 2019 09:41:37 +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; Tue, 20 Aug 2019 09:41:35 +0800 From: Sam Shih To: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding CC: Ryder Lee , John Crispin , , , , , sam shih Subject: [PATCH v4 2/10] pwm: mediatek: droping the check for of_device_get_match_data Date: Tue, 20 Aug 2019 09:40:17 +0800 Message-ID: <1566265225-27452-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566265225-27452-1-git-send-email-sam.shih@mediatek.com> References: <1566265225-27452-1-git-send-email-sam.shih@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 6C581FDD24463BA74DCB1709732549CFC83635E84E76AB67D63C837A63CF9F982000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: sam shih This patch drop the check for of_device_get_match_data. Due to the only way call driver probe is compatible match, In this case, the platform data should never be NULL. Signed-off-by: Ryder Lee Signed-off-by: Sam Shih --- Used: https://patchwork.kernel.org/patch/11096905/ 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c index 287fda3674ce..f9d67fb66adb 100644 --- a/drivers/pwm/pwm-mediatek.c +++ b/drivers/pwm/pwm-mediatek.c @@ -236,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