🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #1274

[PATCH net-next 24/37] can: cc770: don't discard the IRQ lookup error in probe

#1274
From: Marc Kleine-Budde
Date: Fri, 09 Oct 2026 13:27
52 lines
9808 bytes
From: Chaosheng Qu <quchaosheng000406@163.com>

cc770_platform_probe() collapses every failure of platform_get_irq()
into -ENODEV:

	irq = platform_get_irq(pdev, 0);
	if (!mem || irq <= 0)
		return -ENODEV;

That discards -EPROBE_DEFER, so a probe that has to wait for its
interrupt controller is never retried and the device stays unbound.

Return the lookup error unchanged, which is what the neighbouring CAN
platform drivers already do (c_can_platform.c, flexcan-core.c,
sja1000_platform.c). A device tree without an interrupt now reports
-ENXIO rather than -ENODEV; the driver core treats those two the same
way, so the outcome does not change.

The memory resource is checked first and on its own, so a missing
region no longer triggers an IRQ lookup that cannot succeed.

Assisted-by: LLM
Signed-off-by: Chaosheng Qu <quchaosheng000406@163.com>
Link: https://patch.msgid.link/20261009105556.301821-1-quchaosheng000406@163.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/cc770/cc770_platform.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
index b6c4f02ffb97..64fbdf14e8ab 100644
--- a/drivers/net/can/cc770/cc770_platform.c
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -156,10 +156,13 @@ static int cc770_platform_probe(struct platform_device *pdev)
 	int err, irq;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	irq = platform_get_irq(pdev, 0);
-	if (!mem || irq <= 0)
+	if (!mem)
 		return -ENODEV;
 
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
 	mem_size = resource_size(mem);
 	if (!request_mem_region(mem->start, mem_size, pdev->name))
 		return -EBUSY;
-- 
2.53.0
Technical Details
Message-ID: <20261009134323.64064-25-mkl@pengutronix.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343712-linux-kernel-netdev=dewy.ru
References: <20261009134323.64064-1-mkl@pengutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343712-linux-kernel-netdev=dewy.ru
From: mkl@pengutronix.de (Marc Kleine-Budde)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 24/37] can: cc770: don't discard the IRQ lookup error in probe
Date: Fri,  9 Oct 2026 15:27:56 +0200
Organization: Usenet Network
Message-ID: <20261009134323.64064-25-mkl@pengutronix.de>
References: <20261009134323.64064-1-mkl@pengutronix.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1116402"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:F/hTbXCRBzLPuTTRp5v/i9YpSa8= sha256:1lFVobR0l0Y5vIk94U9V2mU8Nhq2NRnSQzb9ZhmjA0c=
	sha1:Yzs5TBTWlC/Z/AqFYLlS7Dp4FXA= sha256:IcBZHBk6u5tCgENM2wX/LcKZbJMiFKWxWKbW0fG81fo=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8BC9710F6C8; Fri,  9 Oct 2026 16:45:43 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.851
X-Spam-Status: No, score=-0.851 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pengutronix.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id C8d6ULfevFui;
	Fri,  9 Oct 2026 16:45:40 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-343712-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 43BFA10F69D; Fri,  9 Oct 2026 16:45:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id 2B88C60B1E5; Fri,  9 Oct 2026 13:44:28 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 679204E50D9;
	Fri,  9 Oct 2026 13:43:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="gRpVXptO"
X-Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5D4F4E36DC;
	Fri,  9 Oct 2026 13:43:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13
X-ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791553423; cv=pass; b=KtwCwtiJW2qrJq8Q3Jvw+bnTGbVmVP8yZp40d4GE7/xx6GSeprNUyI+NNokMC3n8gEAy/TXHP2RZ6SGGi8aCC9WDq3ExwgSexh+jo+RK8EsH53TdnErp+tnhpRbQFFO250DP/0inQLh/+qbzgZ/WhyggpgEMl57eZfDcKBkoKlk=
X-ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791553423; c=relaxed/simple;
	bh=tA8AhGZk7hbowSNlGPvIS8pWHJEEWQqOHheerDGc62A=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=nGGFoJ5872ICjjgzQ9Uum+bWbVKko0RJpeFw+6mIPECVePdRyBjSI8jTZfdj9SARpVdaDPIpObT+YvhcdgiHEyXF84D2OJYHPlkblXT49pSlKeupBufPPCTJvonRvue/0gwBXb+dDYhzaDWL62RMM+PxoOR+VFYMM5cOX9RGF3I=
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=gRpVXptO; arc=pass smtp.client-ip=185.203.200.13
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de
X-Received: from drehscheibe.grey.stw.pengutronix.de (drehscheibe.grey.stw.pengutronix.de [IPv6:2a0a:edc0:0:c01:1d::a2])
	(Authenticated sender: relay-from-drehscheibe.grey.stw.pengutronix.de)
	by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 7298D202664;
	Fri, 09 Oct 2026 15:43:38 +0200 (CEST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1791553418;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=nrV60qykOkiFooqhY7dbMa9F9uJN5Ez5A7f3T3LfIQQ=;
	b=gRpVXptOgQi4UVE8kaqOvk14yIYwTUoEcP5Oh3MPqXMb3RSyubUreC0+mvj2UUohwEMY19
	VH5oQsN92LjN2poaU6utCp3b2x0EKvW0/Q7ROIBaiY/pX7MlWy1KDKR7wYGEFWAOHHN7Xb
	ngizORk5iAKNqq8muQoDb4lQcqagqmN0Ma3G5jze91IMOfkD9P6BlVKLrbKjMuxYg5u5wR
	yJuPd9znITvCtsIGOLssTY6Z/JZEanvzn5LzMCihzrWmbdKFijxHDQJlgfkSR354JBEhhq
	vThlmmBGFFMCA0mVxVSVDbI8uQ3aDxo/7gkEnc5j5h8gQw3vGLTiYqm6uGcnKQ==
X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1791553418; a=rsa-sha256;
	cv=none;
	b=YS8ppiw0B8EkSVhIjvbGXbn3ns6RfW87nR+jPk/MtagrQtB/hSp2rCUgBpQK/62MOMkjjL
	xgacjx1VR6/OVsZFPqD/KR0y3+5uFrsOUchbx3elXHir+zhdkAPg2q0Sp1JK57p3LJOo/L
	SsDmFOKaWZrIigBiuZ0Ir2jHyob0P06NJhIqTeA7kh1PhWnnweP7u5FnMaCERVWgbJx0BD
	HCq+IeLdx/Yod+uiGi/B4b6yOFqrLllwe2ffw2qfI//Svmukkp9uugSAtodFu1yQ6AiEmq
	RalSsbOaADvF93j7UER+3gFPN7o8VdugGtKJmt5t4BSWuxnul0vy9tUXXMbURw==
X-ARC-Authentication-Results: i=1;
	ORIGINATING;
	auth=pass smtp.auth=relay-from-drehscheibe.grey.stw.pengutronix.de smtp.mailfrom=mkl@pengutronix.de
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1791553418;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=nrV60qykOkiFooqhY7dbMa9F9uJN5Ez5A7f3T3LfIQQ=;
	b=RZ/QwjyO0f3A4X8nxmqtSmduvC9w/J3rbi2R7pMUXqgERAQuWfHsXynBgBNDWNEfw6osPb
	jWRJqtRPpPKbNuqFAc3OLwdPIMmLDsbHL3bYYg0K3e0uRfOAKa69wW2TJ2atpQmDec3Zj2
	4CJx0aF/5i6A5plQf9MfmTb8dH7XbmoS+o4MrTe5O6wQW4mrB88CPHny60JUN9a5jumxsn
	h0DJnRtWaHwEal5RynCN4Nxa6g8PNmI2bEuFAZn6QAuGEWgObtD97J9OYkB9Ws8Zf+M49I
	9kcnjibXK/V8Tx9rLT7wFNG9Gg9y0DqZe6otovOBortG3CcIFReK+Kera11Tlw==
X-Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] helo=bjornoya.blackshift.org)
	by drehscheibe.grey.stw.pengutronix.de with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
	(Exim 4.96)
	(envelope-from <mkl@pengutronix.de>)
	id 1xFAss-0053T2-1B;
	Fri, 09 Oct 2026 15:43:38 +0200
X-Received: from blackshift.org (90-182-211-1.rcp.o2.cz [90.182.211.1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	(Authenticated sender: mkl-all@blackshift.org)
	by smtp.blackshift.org (Postfix) with ESMTPSA id F32785BD8D3;
	Fri, 09 Oct 2026 13:43:37 +0000 (UTC)
X-Cc: davem@davemloft.net,
	kuba@kernel.org,
	linux-can@vger.kernel.org,
	kernel@pengutronix.de,
	Chaosheng Qu <quchaosheng000406@163.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261009134323.64064-1-mkl@pengutronix.de>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>