Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp969509lqs; Fri, 14 Jun 2024 10:37:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtlpi871RURDXsD8KjVwiWJghtlKefZCldtBScCNNjXyhf0fZslYZCtDwTCdLKGQ/GHulEljl15+lB72xbot76AyYiB5or0cbpcvwnkA== X-Google-Smtp-Source: AGHT+IFuX2Tn4/WjukM0US720YG3DGOFJ93Wyp4U7VACWjyLJsLp4pw4NXNFVwZvXlBFquo179uA X-Received: by 2002:a17:902:d2cc:b0:1f2:fcc0:66f with SMTP id d9443c01a7336-1f862323439mr52038805ad.31.1718386644804; Fri, 14 Jun 2024 10:37:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718386644; cv=pass; d=google.com; s=arc-20160816; b=rh7SwtZTXmjf181zVGAz8kTWcogsPWNWyBEAk6v7AgSTdQolNNRoKva4U1twRYPguV qQuzzJrDMqT3+KUjkR6tPjm7Yd6XAikU2f7I0QQYpy95jpZKPLXchGYe4GjtVfBw3WrE RNFKUUG3F3aRr67s0EI8AFcfLJgw63BCKWZ6MYvdhnYnFAlhzlkT1E7p8r90VrRyzcaJ yF9IfidMOAQG9+Go/3AQ+T7Z8RCMjqjTTIZaiVQahJ2LLRKk2hC25LfJvZVlhAUj1O+y oETIA5Jcwxnj5qVIbstbGrm3ZSe8rf2UzGCtahy8+AiwWrzJkgyDHcQ0FK/h0bCbjE0f GMGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dX/NvEFRPKEGikk8fwukiwvaTdASJSmA9+QFa3LM6Fo=; fh=bujJSrd+k1h/0aZbC1LeFD2/cY2NpcCgJFppOaBslqM=; b=IjgVeZWYe920iCLDSuReh5PsDYQhdh2SuChU6xM+x1M1y6o2RqC0D4WZVlR0Zpsx8P 0qbRwUPUyhZwez6pWvBh+hqg6rPyPctYTX2Pu0nuRROUof5sOh6N3x6ywFAWv6m0uNY5 5Jw/NgTDlFuEElOfQ4DD1HXNS4OZzCXlDAIrcYDJmW+zz4cmH7typzYO9nwkxkCTmBon 7pDrTbKJ2jiWLhUVWkH2TvPQpfQcaEmB/PCD6K2v5cHAzZC/L+JAK1Hl6PsXntrkK0AS zyy+3zOjJUCycjTC9uAtgIx3LUVzw0FXH/9UF129aBjXXFFlYU8+sYoLlifKjhAcu/tm Bw9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cdBiBEET; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-215367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f855f356aasi38787285ad.645.2024.06.14.10.37.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 10:37:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cdBiBEET; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-215367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 256AF28E2B3 for ; Fri, 14 Jun 2024 17:34:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7E831AB502; Fri, 14 Jun 2024 17:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cdBiBEET" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 31ED519E7F0; Fri, 14 Jun 2024 17:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718386377; cv=none; b=PH5yDjNFwNf1zGkX2WNCqvlkXiW5Mo0psLtoL75MG5dNX206WCQGQ4aovLjrbRyJlmf8anQ555rh3g9Jv3tdhxH2OYpocOstHzF7139p3VIJUlflvjrTXGauBrtDLLCWdT2liyJ0Fa+DRlySLSrrLBb78zBiEj5ldKcqSeSAiwE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718386377; c=relaxed/simple; bh=rCrSH+2eotbtSZHus1OO9vsM27on3YTkQLIXSX3Gn20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BJ6QM5TCcUExKJyUvqoGtWk8aDiVLljZu2F8GCDJkQyyHPWf1do+Y9h/Q1tg9n/14jA9UP2VTJNSAdfQQfqhwPRP16sBykf8IwUV7OZ2KUQTXqWeOYeRQgL16ORCh7DW4fi8YrW/25Q/puZhS6QDzCYSmlZIbpSbjZSPBJxybzY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cdBiBEET; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 042AEFF80B; Fri, 14 Jun 2024 17:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718386373; 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=dX/NvEFRPKEGikk8fwukiwvaTdASJSmA9+QFa3LM6Fo=; b=cdBiBEETH3brboDNfayAgM3woKf5vj4k+CQ5YUUbP085D876D2hYH2lP6MDnIMck9yqphV qNvDKs53bNCkYxZ/qE7ENTcj33R3ZaHdCOBFx48ljIbzv84YnX5c26N+NfhBXupdgYPrpQ ZhrhAR0ZAm5TyFduZdBIrvG1jX4I0354HZsoQ3sD/vzpqqWzLyZUUxLecKtVQy5oIphQa1 2yTpLY+ZiVxBlstiUK721FfVjz2datIWgNf3wXPsDnAHBvVv+bv/wk5X/47L2rq1VAQ6Qu Y4wc720rwxdXpS7aM38Dm8sAxyxMIx348GFv22vG8cCa4FS2punTlySJ/AJs/g== From: Herve Codina To: Matti Vaittinen , Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Weinberger , Anton Ivanov , Johannes Berg , Marc Zyngier Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-um@lists.infradead.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni Subject: [PATCH 09/23] irqdomain: Use irq_domain_instantiate() for hierarchy domain creation Date: Fri, 14 Jun 2024 19:32:10 +0200 Message-ID: <20240614173232.1184015-10-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240614173232.1184015-1-herve.codina@bootlin.com> References: <20240614173232.1184015-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com irq_domain_instantiate() handles all needs to be used in irq_domain_create_hierarchy() Avoid code duplication and use directly irq_domain_instantiate() for hierarchy domain creation. Signed-off-by: Herve Codina --- kernel/irq/irqdomain.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 7e4a1da63549..edfd386be985 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1213,23 +1213,16 @@ struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent, .hwirq_max = size, .ops = ops, .host_data = host_data, + .domain_flags = flags, + .parent = parent, }; - struct irq_domain *domain; + struct irq_domain *d; if (!info.size) info.hwirq_max = ~0U; - domain = __irq_domain_create(&info); - if (domain) { - if (parent) - domain->root = parent->root; - domain->parent = parent; - domain->flags |= flags; - - __irq_domain_publish(domain); - } - - return domain; + d = irq_domain_instantiate(&info); + return IS_ERR(d) ? NULL : d; } EXPORT_SYMBOL_GPL(irq_domain_create_hierarchy); -- 2.45.0