Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17893949ybl; Thu, 2 Jan 2020 14:15:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyThWnp6So9tRTjTM7dPjnUYPNKw7LRw5awpUi2BM/aPqnOPLTfVyS3wcGmNj7T4JP6Or+H X-Received: by 2002:a9d:7851:: with SMTP id c17mr74146588otm.58.1578003318496; Thu, 02 Jan 2020 14:15:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003318; cv=none; d=google.com; s=arc-20160816; b=vo5dbpUNDJuJgEX5yXYATJ+Tq0BDXY9fRRCYbo7tCPCywFXk6K5MMZ9/rSYoXIqhje vDM/XyozNv/wiiyRWk+Dc0RNnSJ1PvWCnfAwNmdZvY0JgJpCH3o798lZJ1hIOo6VrGna Hqp2ZMN/iSQQvo1W8CfOGcBRjKsnPSyBcy60R0JADqzifdEwzKWI9vs7Nx+vjfizSvLX cWn22pekhQHyJzr5yJwywRCY2Y/vYFjNDkmI0K/ssAYFcAhTMQjzaTq3BO7P7LDbbImZ JWDbp7GGzoCgLiWMDMBTBxPu5qQ2wH8A55bKqhYzphMdhKYm79wc4bXVQVYqyLReZPdX zvfQ== 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=qP2STtUkvC2tEi6AJNssSLozQfHUs/B6PgTFVnsnzhE=; b=tL5W4aifUsEH8P4bhRjyqLAx0RQLJim2qg8KqS9dSZi7cCHvh7tBV7Jkv77KS0atmK REYNknQXrgCaso+/V7DsOK6ihBZ9Cdt8OZ7dci5ZJXLEKJ5q5wf70T6y+bRf534fV9tE HRksf97FpwfNG+UggjGiCmzsWW07PjUI+9IjASanA3rCeuNptgNzLLHS5asXmjwPEYSk v9tYa76Tha42jHlQqpPhIfmHcq7AimlN8e6gngEZ3XSdt+9KbGWnRLVA5ULs/E3+GA2u 9O/4UsQozeP4NHdEwbXAhFkHW+JgsGT3ZKubqo8+3w/0yYM9qpAJqKU2HfJsO9Hn4UJy /5pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KFC9Q9zl; 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 v3si10209734oth.104.2020.01.02.14.15.06; Thu, 02 Jan 2020 14:15:18 -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=KFC9Q9zl; 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 S1727612AbgABWNG (ORCPT + 99 others); Thu, 2 Jan 2020 17:13:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:52570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727602AbgABWNC (ORCPT ); Thu, 2 Jan 2020 17:13:02 -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 AF6AB22B48; Thu, 2 Jan 2020 22:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003182; bh=pDuXdvwcH9iqYEt10AaDUURx/7FQZnI+NBdX5KLKZNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KFC9Q9zlTS/EfAZB/GmbGgG5o2flyY1gYOUU2oUCVPyaSqzXOFVaRp0cqjP8fyo1J WFPT2rDO0Pw6ACzF8k0OjbdRKYGTBT9o6EYpa1Hl7slLO8R7tr4fpcxkt0+xFwGrx+ yuaUZqYrDfrkMzrCGegPGtwOm6JCgTNepRQIipRs= 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 5.4 053/191] irqchip: ingenic: Error out if IRQ domain creation failed Date: Thu, 2 Jan 2020 23:05:35 +0100 Message-Id: <20200102215835.586756286@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@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 f126255b3260..dda512dfe2c1 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -108,6 +108,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) + @@ -134,14 +142,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