Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1852700ybp; Fri, 11 Oct 2019 22:57:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQal9jNj69IKy3gCO3oUuhfpwVdRc0spWWeVklsbBGV5LgIEA1KK5tDm//db+EOfHmDWZQ X-Received: by 2002:a05:6402:1687:: with SMTP id a7mr17243376edv.222.1570859842940; Fri, 11 Oct 2019 22:57:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1570859842; cv=pass; d=google.com; s=arc-20160816; b=g7e8QcQDuutArdm9kBzGt6Tuwl4e7Gb+XHrtOW5yuPwz3NDrLChDXx2mmDlEEqlZRX sZ8tQJSNmdJVJ/rM/noCtzwEq/94dEhlMW6mu4nbYwASxv4awsMIDaHnDgIg6NheaD54 gdXXajPQIPDLAwVr0YGQ2iDh9+KL0L6V4RYkMHOZ/i/rUpSQtpa5v2EAqhsQD1NgMc2B szpoq6MpdkGaEJKILjoZ/cRgUb1Ra0vmtlSJmwT+FGP5yI7AzTzFH1JTfStqDjn1KlNH PdC9xm2iWaqGWEW4AyJmHIkIZSKRZrpst3OjHNMc4aab5qKkdFAutkextrrsY9cVSOzU Di8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:domainkey-signature; bh=8Q1QWDHPH4FrpfqMll+CRi4+P395ePJNtqPkkMOo1qY=; b=YHvXVBtSR1v+c5rDtWJG1b60YC8o4fevKMd+sSKB0SqiqJgks9GzZu6LGw0+b6/alV grxrhX9p5Jl6BKTs7L3to46EdVqs8eC/5hILQ1VDk+L/DxTd14XGbYNVQOomiH/7ZGx0 w66pJVuniPE+K5qfmG4O9th6BGJSmtVqzTKGOCmJzITXcZlcsAFPtfRceAA3I0tJE2LY NjtqkPedYH9oEp7lEH7J0lVMx7EWEoISmaZqWy3o8+LpiIUGRqMdKXfYlhj2VhVoMdaN KcFCSFcs/stVeQ3Ui0fG6k1S87MrDcT8nfjvfnXp3zhPiuIfIUHe8qvLjKxsD4xWRKJx aXKw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2019 header.b=flJo++4H; arc=pass (i=1 spf=pass spfdomain=zoho.com dkim=pass dkdomain=zoho.com dmarc=pass fromdomain=zoho.com>); 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si6831586ejj.360.2019.10.11.22.56.37; Fri, 11 Oct 2019 22:57:22 -0700 (PDT) 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=@zoho.com header.s=zm2019 header.b=flJo++4H; arc=pass (i=1 spf=pass spfdomain=zoho.com dkim=pass dkdomain=zoho.com dmarc=pass fromdomain=zoho.com>); 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728636AbfJLF4I (ORCPT + 99 others); Sat, 12 Oct 2019 01:56:08 -0400 Received: from sender4-pp-o94.zoho.com ([136.143.188.94]:25471 "EHLO sender4-pp-o94.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbfJLF4H (ORCPT ); Sat, 12 Oct 2019 01:56:07 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1570859679; cv=none; d=zoho.com; s=zohoarc; b=MUJihpGopBf1M3h2L8QLEDTiRqDcqFZmviCgeAwkfCI5ieP32AP7u72JG5MBIoigfC5yZqUQLcw87FUOrlAsBEzEFTgHSWHTH30VN90Ef5NueHBcp1EmhNOvBnwoyILt/8v17zlDjSo7yQ51YAgiNqmXK0rYUna3YU+lUUFrSrY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570859679; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To; bh=8Q1QWDHPH4FrpfqMll+CRi4+P395ePJNtqPkkMOo1qY=; b=ZT7cGCNC/0kqWvLLyZkUEHXgh8KdmpqYYWkaTg2Mx9E4GQ9RUTV46b8nEvIBgzr8vv1O1o5jjC6cw9AIjX72R7KEyI8wAf1ZpPWG8KX86bwwXDGteRhHnfqc7CYoPo5uGBLSdAZ3KzU/4OrpZX2FpTxrietSYdKXBwfxDMxNMCc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=zhouyanjie@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=BCj4gvZ9YL4inNkS9uke39eKBXeDLvq6ORVxS7dwb371/+e6OI55+Gd6XQICXvxotwhkcwxRVEex VWveCm7f8VcVSNnZbm0sL7hxE7AZ3S5ODb+ph4/oYjgN1eYEJdTc DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1570859679; s=zm2019; d=zoho.com; i=zhouyanjie@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1444; bh=8Q1QWDHPH4FrpfqMll+CRi4+P395ePJNtqPkkMOo1qY=; b=flJo++4HdkOsp+Bbufh2eIbDR1E9dkeLs8Y/Kn+pQutNEUYZzwHV/Au8TJNSCiRQ 3DPZRE3FrwjLF3+D9eT1R87ekee2kiSRmvMl9aQHd1lE+pjzFhdwPqkK4mbEr99SMdT 1eyQbPNkNrZBKbonz7ylO1sS6Fgsf6MOQ5W4eEMs= Received: from zhouyanjie-virtual-machine.localdomain (182.148.156.27 [182.148.156.27]) by mx.zohomail.com with SMTPS id 1570859678068815.4253499907817; Fri, 11 Oct 2019 22:54:38 -0700 (PDT) From: Zhou Yanjie To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jason@lakedaemon.net, paul.burton@mips.com, allison@lohutok.net, syq@debian.org, rfontana@redhat.com, tglx@linutronix.de, paul@crapouillou.net, maz@kernel.org Subject: [PATCH 2/5 v6] irqchip: ingenic: Error out if IRQ domain creation failed Date: Sat, 12 Oct 2019 13:53:47 +0800 Message-Id: <1570859630-50942-3-git-send-email-zhouyanjie@zoho.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1570859630-50942-1-git-send-email-zhouyanjie@zoho.com> References: <1548517123-60058-1-git-send-email-zhouyanjie@zoho.com> <1570859630-50942-1-git-send-email-zhouyanjie@zoho.com> X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Cercueil 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: Zhou Yanjie --- 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 06fa810..d97a3a5 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -87,6 +87,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) + @@ -112,14 +120,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.7.4