Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11792190pjo; Thu, 2 Jan 2020 14:21:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzWDpdPQBXmVnv7PBR+qyd04FyQHwSB8xLX/grMVDDTLIZPIaUlM7kWB7S8iaZ5xF3hiQTZ X-Received: by 2002:a54:4117:: with SMTP id l23mr2955822oic.140.1578003697219; Thu, 02 Jan 2020 14:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003697; cv=none; d=google.com; s=arc-20160816; b=rZCFnBxX5d9y0bRzEArzIjAoEXH3YEzRwJbvj4PcnZh/z7DmAa9Kx5QjQUpC3IF45f vw15xXSm5OpGfFhljketXFGIrjElMBzUc9MXQWcc7CosdSXZ8j5L99kscVakv6KO8fKO /35t+NGLR8zIIe4ZR6eTzHZziMiKmzvsqsluh3vStiIeu9msXCOWb99sBQS1sYYupTDZ wymEOeQ9Fn0H8eKdymKPhaPqz/VGL62c8xQQpA9PC7lhDRmyNgrG3oLJUspEuzetCsXJ XTV77iUpl4slmKAzO2gze4TFQEKVVKUvQo7dwxs9K0Br9pkQ219gXH5YsHkvhM9/move mR+Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qFjE1BuhGv7HUZvVURPF+wcHM7e8GMKx/5r6pF7U3XQ=; b=viionetws/WSJP2L34S40HwwZcFHDPf/ep+CpBY3W5zBsAooRiaw4ATc5MzubH1ZjI XkRtlT/l2CWEkEOBQ5l5ua85eqEmb6fJdY6jgVH9ZvzWBnX0yNZeSa0ZbfPrKi5BtHqw WVjzGJrmJ0zAOW4pfrrWGW+ZkGfFlYHP/vrTveU4yq+mnFHAnXSAXxdQFPxKoPIk44pr cAuIV7EQ8Ymdcwvtf6h3vNh0yQBJUNtsyMdFyiU9KbvKhKMINzl/g+jwlC15b9V6B2Ud RnjBTevuKG06nTS3bV/jJC1cqMBaHVhnnD5q6FlVW7oXUYP3JHkQj3dgbxLvLaByYLxn qZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BZtjUkK5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si29887825otn.281.2020.01.02.14.21.25; Thu, 02 Jan 2020 14:21:37 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=BZtjUkK5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728668AbgABWTt (ORCPT + 99 others); Thu, 2 Jan 2020 17:19:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:36324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728657AbgABWTr (ORCPT ); Thu, 2 Jan 2020 17:19:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 489AB21582; Thu, 2 Jan 2020 22:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003586; bh=AFNVl8nrgOrO2tqw7CjSzHBMngU35vBQOYU2AwsBhrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BZtjUkK5SItZ1f+Dcqfc7MxigmmT7nRATkSF2Ut7qPC2/wOYedyDtLHLqf0R5Js+B QVScHDn0rdkcfglkYAKhiR8YYouZVtxEBhJ739C/Vsen8Eeyw59nUVa70qYDBDOVS6 MlQhAiUUTYTQ2BprC/bEOo60Lup1Dh5JE2NRyc6M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Cercueil , Marc Zyngier , Sasha Levin Subject: [PATCH 4.19 031/114] irqchip: ingenic: Error out if IRQ domain creation failed Date: Thu, 2 Jan 2020 23:06:43 +0100 Message-Id: <20200102220032.233364107@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Cercueil [ Upstream commit 52ecc87642f273a599c9913b29fd179c13de457b ] If we cannot create the IRQ domain, the driver should fail to probe instead of succeeding with just a warning message. Signed-off-by: Paul Cercueil Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1570015525-27018-3-git-send-email-zhouyanjie@zoho.com Signed-off-by: Sasha Levin --- drivers/irqchip/irq-ingenic.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-ingenic.c b/drivers/irqchip/irq-ingenic.c index 2ff08986b536..be6923abf9a4 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -117,6 +117,14 @@ static int __init ingenic_intc_of_init(struct device_node *node, goto out_unmap_irq; } + domain = irq_domain_add_legacy(node, num_chips * 32, + JZ4740_IRQ_BASE, 0, + &irq_domain_simple_ops, NULL); + if (!domain) { + err = -ENOMEM; + goto out_unmap_base; + } + for (i = 0; i < num_chips; i++) { /* Mask all irqs */ writel(0xffffffff, intc->base + (i * CHIP_SIZE) + @@ -143,14 +151,11 @@ static int __init ingenic_intc_of_init(struct device_node *node, IRQ_NOPROBE | IRQ_LEVEL); } - domain = irq_domain_add_legacy(node, num_chips * 32, JZ4740_IRQ_BASE, 0, - &irq_domain_simple_ops, NULL); - if (!domain) - pr_warn("unable to register IRQ domain\n"); - setup_irq(parent_irq, &intc_cascade_action); return 0; +out_unmap_base: + iounmap(intc->base); out_unmap_irq: irq_dispose_mapping(parent_irq); out_free: -- 2.20.1