From patchwork Mon Nov 16 17:22:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 11909811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04097C2D0A3 for ; Mon, 16 Nov 2020 17:24:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F68920855 for ; Mon, 16 Nov 2020 17:24:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M4e6QrZP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="c8RGXFRO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F68920855 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=EZtflHmuU48w9CLgwCztPsZfgekGzW5Y+1CmvxGhrQM=; b=M4e6QrZPelTESQRyDjvILIogvA V2k06BxKO/K1ihQddpKmsRlxu6kyG61soHgT3Lrokjaju5ib3sG1gtsqg8stTeVJlgHGpZygXzeIf l2nTTKm9JVnmFUy4FBpyRHlngR0Ye2SxeuZt2fjz+bQDLttg06aIP94QgI/50f8qPS6CaBYhuvHcT Kb3IZUHfDcY4tj8WUZ+psXhkBVYQNNSGoirCCoecp1vnhgNlSZQJP+FxNermdnnXLWvImqG2w5ixf Jb6wLoG8v82hV1/evfXSebEXRbZsA9NuyVEqfeDp5nSmX6awouXB3+knf+btsb9VhjCJpcXwXpNdG CVrYQBMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keiDv-0007kR-8x; Mon, 16 Nov 2020 17:23:27 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keiDs-0007je-GC for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 17:23:25 +0000 Received: by mail-lf1-x144.google.com with SMTP id w142so26186460lff.8 for ; Mon, 16 Nov 2020 09:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xe0fMMeWtHOe5r/TW86ewhH8HsHgvaAGNFwF6cTdlFA=; b=c8RGXFROHQu8boX9DdGFDwF3PhECcZPFQvj5T9RyQm3N5h2KMHDuqHdz+CsbMyyg8/ gkTctVOMzGHsRSOoOpL/E765Ch4nBh1DpDoodhZZfwgYWAUYq6iRFzovqctwoX9DgqqY 2mkalWGL6cUDK/oxzUyDn/m64D1FdZSWh51IGZe+sgG9J0KOseiuFcjqE3uLhxgYvSLb NZlq30CTtv1Z1v2QGWrfOBUGWYdS1BtVwrD2P/gFSMdR0stw22slrPbpvqVOiR7sEAyL iAI6fBbeLwMpijiik3h44fLEGB16k+Q+BaEvuptLBRwMfKSpE4vwQl3xTYQ+pkeDbsLI 7kuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xe0fMMeWtHOe5r/TW86ewhH8HsHgvaAGNFwF6cTdlFA=; b=VnBI2epsPmo6W2dnseVw5FXDpnwh58HOzGuED8tmimmfTtJ98lMRXJMo8+GnvwJl53 1LVLgB6NUMxFiCqZpGX1E4ybiE6xoL6Rgb3y41p48zXIFoPoTB/DWXCs2AQVChmA45XB b7nMIETIdKkKoRtXElcYUD7/W57ZH6DtFQfdU6t/TQAb2Iw8pvgLpHriISnzCiLR9QMr QC61hzajOTXTchvTRGUUO+miM841OpTNFu297O8O7rivLDl49wTz7KlyUdi1utguDj1g dU0SdJB8VsRIe1G2EjeLYGSukaTkls+GlkzQG6M373jWlQ02nDn+XlATfEaPkpJfmnWM 00Hg== X-Gm-Message-State: AOAM533ijcwO2o6QA+zcknAbnL45lOCxlc6pgI1vZnmw9Oz0a1qPuW0g 178EafBLAUGDsTclhH7EIkx3ag== X-Google-Smtp-Source: ABdhPJxWBigDJOTdzFbPNBFUBYEo5pxgVegR1CuNzj3Tmktf9fM+63oaZ3B6V0GLx6L6wv4WkT+xAw== X-Received: by 2002:a05:6512:1095:: with SMTP id j21mr138346lfg.309.1605547402624; Mon, 16 Nov 2020 09:23:22 -0800 (PST) Received: from gilgamesh.semihalf.com (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id d28sm256378lfm.201.2020.11.16.09.23.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2020 09:23:21 -0800 (PST) From: Grzegorz Jaszczyk To: ssantosh@kernel.org, s-anna@ti.com Subject: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value Date: Mon, 16 Nov 2020 18:22:33 +0100 Message-Id: <20201116172233.18459-1-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_122324_645234_A8A72FC0 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: grzegorz.jaszczyk@linaro.org, praneeth@ti.com, santosh.shilimkar@oracle.com, linux-kernel@vger.kernel.org, tony@atomide.com, Wei Yongjun , linux-omap@vger.kernel.org, lee.jones@linaro.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since the of_device_get_match_data() doesn't return error code, remove wrong IS_ERR test. Proper check against NULL pointer is already done later before usage: if (data && data->...). Additionally, proceeding with empty device data is valid (e.g. in case of "ti,am3356-pruss"). Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX") Reported-by: Wei Yongjun Signed-off-by: Grzegorz Jaszczyk Acked-by: Suman Anna --- v1->v2: - Add the appropriate Fixes: tag. - %s/Remove/Fix/ in patch title. - Add Suman's Acked-by. --- drivers/soc/ti/pruss.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index cc0b4ad7a3d3..5d6e7132a5c4 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -126,8 +126,6 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node) int ret = 0; data = of_device_get_match_data(dev); - if (IS_ERR(data)) - return -ENODEV; clks_np = of_get_child_by_name(cfg_node, "clocks"); if (!clks_np) { @@ -175,10 +173,6 @@ static int pruss_probe(struct platform_device *pdev) const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" }; data = of_device_get_match_data(&pdev->dev); - if (IS_ERR(data)) { - dev_err(dev, "missing private data\n"); - return -ENODEV; - } ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); if (ret) {