From patchwork Fri Dec 9 14:01:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 31770 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp795863wrr; Fri, 9 Dec 2022 06:08:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6c3pSqtAEyztfMpU5qu23MW4fSmXNLl75RJGuXiXNaJAsVKku/ZiNbMU+lsQtKuOs8hnqs X-Received: by 2002:a05:6a00:88c:b0:56b:f51d:820a with SMTP id q12-20020a056a00088c00b0056bf51d820amr7338766pfj.7.1670594926926; Fri, 09 Dec 2022 06:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670594926; cv=none; d=google.com; s=arc-20160816; b=QyjWmuwY1Mu7Zbi3Ot4l8FOgDF75V1+p0cF6KjAeSy1E2SZtHgQsiBCpf0hDUwTCIX 6gUktFi29UwbuaMuInV/dDQuCLyePKVXXRgICdvPOpERPnwD4gpMwtXMWTQ+6zJ33lP1 XuRaRUyfcPsXJQCnjdWRPaglyy/FwYf96D5JZfMoCvXtas8EAxksKe5c6hrqjk06Bnz8 7e+vgQK1+J8XRYLVrBEph2z5ew+6DUDyU3s+L93gt2MNbrAfxazVjsyg6Um1vC4Fa/nG OsqPEajIDuu91d9CEcmwoFJeSEbO9JlJHI39ZYk7C+Tv7ybryGvaTtIbj6HRl9W6HZHQ wEIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1E2U45qA8GMGqDEw3uygGu4V0CmHBUDj8JwaZvgmTo8=; b=hPnnL3T/vnyxy9h/2oVcJP1lgYMH3JTghUSB5TuyQYpsSmCQipmP+j9rr3Hlio2xQa elWptabXQYpRPoIplkA1bCjVj7bLP7vPDTQ3Rcv474Bvly2yMPVCyElIBSZRY8tqRzhT t3huU7Z/sNTfXS+fggbwdDqnz8GQ6Csz6f8Qq3pIilX5Hu3BNU1X9rrhO5tP3CHyJcAL zA3TSdMe1Vwkm/hVee/n5vS+eVZ2bNzPBmB3udcL7JZAHoneBn73aGnyfRSTJr5VSadN ADROD6v4Q1XDINk8IR6IRVVNbUTUDYFJSflAMJidReJogLgTAA9Y3pkzrfXOrPeflevU bGKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9U1EWXH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u141-20020a627993000000b0057576b1c933si1667934pfc.340.2022.12.09.06.08.31; Fri, 09 Dec 2022 06:08:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9U1EWXH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiLIOGW (ORCPT + 99 others); Fri, 9 Dec 2022 09:06:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiLIOFV (ORCPT ); Fri, 9 Dec 2022 09:05:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DCC97869E; Fri, 9 Dec 2022 06:05:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7972762284; Fri, 9 Dec 2022 14:05:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71032C432C6; Fri, 9 Dec 2022 14:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670594714; bh=4RPPmHlyjmlFUoLHUFxMf8HvCeMtaA+C0YRncoYi5r0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9U1EWXH4g5czfiJcl1sznKHcybwXhDHSvBNWqKAoKXukqvbk9CcBWG6iNGfjlgsu zDW5xeYGQe2Z6XJmQXKV2lG7bkPVFqR10B/YTiDFu+wL3blgNxOYtlxgkkSXPBZA4V NDOHRvSCTENf4pJ0802Q0WI51jPP8l5IdCI7KFftI/9WBagQZziZAaILSb8B8XvQ6I eYq3s3TwJwJRGUC0ZbZ3phmicN64cDLZfjnoJGtmY8ZmZzqRBo4IDPP2GTSGSUaQNA Pooze409PSzu4gDkgEIa3EYs+BWgusMT1PdLk9xUqhqIdBYVdq6Ku9Q4BPRar0NVEi IUBq3zuqxbTWQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p3e0J-0000SA-Nb; Fri, 09 Dec 2022 15:05:31 +0100 From: Johan Hovold To: Marc Zyngier Cc: Thomas Gleixner , x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 17/19] irqchip/loongson-pch-msi: Use irq_domain_create_hierarchy() Date: Fri, 9 Dec 2022 15:01:48 +0100 Message-Id: <20221209140150.1453-18-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221209140150.1453-1-johan+linaro@kernel.org> References: <20221209140150.1453-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751745745829827736?= X-GMAIL-MSGID: =?utf-8?q?1751745745829827736?= Use the irq_domain_create_hierarchy() helper to create the hierarchical domain, which both serves as documentation and avoids poking at irqdomain internals. Signed-off-by: Johan Hovold Reviewed-by: Philippe Mathieu-Daudé --- drivers/irqchip/irq-loongson-pch-msi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-loongson-pch-msi.c b/drivers/irqchip/irq-loongson-pch-msi.c index a72ede90ffc6..6e1e1f011bb2 100644 --- a/drivers/irqchip/irq-loongson-pch-msi.c +++ b/drivers/irqchip/irq-loongson-pch-msi.c @@ -163,16 +163,15 @@ static int pch_msi_init_domains(struct pch_msi_data *priv, { struct irq_domain *middle_domain, *msi_domain; - middle_domain = irq_domain_create_linear(domain_handle, - priv->num_irqs, - &pch_msi_middle_domain_ops, - priv); + middle_domain = irq_domain_create_hierarchy(parent, 0, priv->num_irqs, + domain_handle, + &pch_msi_middle_domain_ops, + priv); if (!middle_domain) { pr_err("Failed to create the MSI middle domain\n"); return -ENOMEM; } - middle_domain->parent = parent; irq_domain_update_bus_token(middle_domain, DOMAIN_BUS_NEXUS); msi_domain = pci_msi_create_irq_domain(domain_handle,