Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3371184pxb; Mon, 16 Nov 2020 12:47:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrgkpjN/0O4RAk+4Bi8arYhwcPPIFLI98RqRuFgsy9UW5zuvgjDGH7z4SzLcq8vUnXojSs X-Received: by 2002:a17:906:f2cc:: with SMTP id gz12mr12119309ejb.181.1605559629238; Mon, 16 Nov 2020 12:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605559629; cv=none; d=google.com; s=arc-20160816; b=shGyX3PkLsUojNItjZdux2AJLGmGwn9HFkGKFZk82xoeMvi747vDXx19HCBJ1ZHOp5 A3R3WqPcNhqo2wlbwjogUKCPZGiNUzNXhXEM85M2peJHOltPpdZwngcR0L6waS2WL8VM BTi223On5o83G6Y2eUgE+YgsEveAok0a99HNNobC9a4pkGGbJHXVQPpE3nNfbEkuSUZh 50PXJtnCQU2iTiH9Ar0/uyDIi+eM9Ki6OjIqjL4DN8Cnx7LEZS4kAM68Ghs8xaJARL0g 2C9o5XewayoE1ggjsqhUGnR8Qstd/BKQZoD1emayDB01HHzO8a9fIvkXIJ1muVZNI/jX +WSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xe0fMMeWtHOe5r/TW86ewhH8HsHgvaAGNFwF6cTdlFA=; b=dLUoJHxIn4iUsnj6TEco1UBcwTxY/R6RbHH6lhX/5+OGDGJeRzcDkRetHnxiStBNzz YMDVY90XguklsYdjRcC1EyzI2FkFBQaEk2BhtUz9QqvhqMjTRwB+izP06g+czXhhpl+g V+covKE8arXiJeTl1QAoekFG85iVDZ5vChNVJJ1aVlLPhEiUNKFT2xeLAb0s4gN5AK7B uIIHffMG8O925YirEmfbkfjskaBIRLqUhDTMALBinf/xBygJwaj55SYdS+QbFQRbuzQs btxlKMW9lKW3ABRV1DYpITxBJdwyJzU7ihx0Kc0Ri1rp9gRblIB0/PuLgz5+h9+SrEJm Ha3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c8RGXFRO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si5710094ejb.624.2020.11.16.12.46.46; Mon, 16 Nov 2020 12:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c8RGXFRO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731926AbgKPRXZ (ORCPT + 99 others); Mon, 16 Nov 2020 12:23:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730176AbgKPRXY (ORCPT ); Mon, 16 Nov 2020 12:23:24 -0500 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23623C0613D1 for ; Mon, 16 Nov 2020 09:23:24 -0800 (PST) Received: by mail-lf1-x144.google.com with SMTP id l11so14144887lfg.0 for ; Mon, 16 Nov 2020 09:23:24 -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=C8w9gHegSzAmoD6yuyyTku/cC8BWybLjx2Jt0nF+fMtr6lzgw0qkM9i5Rcd0gBFL2j BcF/kvx5KTiA3vDGEuurJFDKCRpwHghpD4Gx3jmQqJ5qh3gzj/cJvm+WTjdSTFnSA0Ig 7fZp62c5IKF77ahZF5aovHlQYSffDBtb8csNB49IVtIsLN6GP8xkQM6tfnAzkmbqDY9t xUta90tsZXEO4i2VSnwiYC2VKqx3QeI65rvm3rVHZh9dZNmOZgG0I/+hKxbuK8AYfUKE eXPRbb0KT95lo+E/9u8DodNwMzZLB8FKVx2ohfnmWxtkop3QxIr1g0zIGYVSb5tdUikk iEEg== X-Gm-Message-State: AOAM533QHfrDW8Ve1F9XpLLhhqkniicujK+Se3eRagz8nFT8E/qcq8uY u/O3ptSIzpNGUW4ihZAD8tQweA== 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 Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com, lee.jones@linaro.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, praneeth@ti.com, tony@atomide.com, Wei Yongjun 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) { -- 2.29.0