From patchwork Mon Jan 16 13:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 44166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1202820wrn; Mon, 16 Jan 2023 05:54:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXvFHguKrm3SBStkN3TKDqrllPBv+Wvi7O+eTikicUbvgi3OfjmBL8UlC40YcQdTxSwVkeCN X-Received: by 2002:a17:907:1819:b0:870:2aa7:6509 with SMTP id lg25-20020a170907181900b008702aa76509mr5296713ejc.43.1673877257545; Mon, 16 Jan 2023 05:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673877257; cv=none; d=google.com; s=arc-20160816; b=WnWmVtgwGSyZbz5M6m/6bZEz6JxqfSkKJH4IXavIpGV6pChkXjhIO0QS6UEgy6/rFt lfVUiG2ho9NIce+YYJ3Ka+s+IZI5g7RcFlkpIoMk77HjxTmToKbdiw/lsYiLnzo8nEEF hedfpJSG0ecru6O7Vwhb7NpoVNUBueKuF82nv3XNL0N1std/vTca87nKjhcrtW/5UEMS TDVwK8delH/XmRMhKQcA4Vly45MDqGUSHEIH6Z9EyM7yO9dwb4Wq919IepLO8YA1xLqg KjYpaSp1rfDJwP267nnmeAQDmObPCfwax/ySdBCYVXwKhXjVidPsiVtD6bujTX1g9I/Q oYiA== 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=GnmZhZFvy39ZbB8/E9H6e2bvYOwkrkfJZNFFYfrI2FQ=; b=kUqFDSwNXkK33NWf47U+raMCL2dxnotrjNtVfSs1oaaH8QrfPBGj3+U1E/b9xKvcPv 52GaS9RwvIzIx2mZOxLEfy9uyI+Xgq3uXxPb5nKovzDR0f4mKHoWyqNvmeH2nDVB9YO1 iPJr17Aff/jJ94YD24kgnQbtxQbULBB/AQ4lZHHZ7Zrbn6ddpz0LfdlFbEXXntPzrxeB /CrEnAFUZdfuKVgIFeRktHePwEW13xXuHRMeavtPJp0Cx//X4ZYHqH/KjcoY+oTjgdmF n+Zh6wKOfP4ksytxZmiR3Kz0iek7iLsNm/yLsHSJbwZixE/2H+f1tTTka7MwG/lCgV66 Krzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bbXomJWO; 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 ds4-20020a170907724400b0081a9c3ca4bcsi32742980ejc.379.2023.01.16.05.53.53; Mon, 16 Jan 2023 05:54:17 -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=bbXomJWO; 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 S231223AbjAPNvs (ORCPT + 99 others); Mon, 16 Jan 2023 08:51:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbjAPNut (ORCPT ); Mon, 16 Jan 2023 08:50:49 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B3F21A17; Mon, 16 Jan 2023 05:50:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id 55C99B80F9C; Mon, 16 Jan 2023 13:50:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85430C432C4; Mon, 16 Jan 2023 13:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673877041; bh=8DJCpUTNn+l1lULiQCFrqNOTi/kGEEvzvK7CyZ3zKZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbXomJWO7ZAWnj9f1IHYWsdNOiKPjuldKfB71I8vFaL289g4PgVvZ2CnJhi/ilL2j EOXhxb9aOaf/dRV40UcEh01ip0NTxDdljQGPOQSM35iD7XRJjJGFuoINFi6X4zdW6j /RoXuxAhmDNa/lkHX8DcvSn2YN1k5llWU5hUt78LyQp0IbWQtdV4m9ys6SupTUcfUl K6ziM4uy2P8E9ektMaOQmOMsco5xoEpjNKYPL9Zjgpq6XigjfRnFjdnV7/nASAASTV ei6wiIrQtAXP01c9vD7v+nyrm+9JCHXzPzN+rsArQjOQNiiUGKZ9macMM+jj187Q+7 ScBzZmt+wfq/A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pHPt7-0003vV-0i; Mon, 16 Jan 2023 14:51:01 +0100 From: Johan Hovold To: Marc Zyngier , Thomas Gleixner Cc: 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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Hsin-Yi Wang , Mark-PK Tsai Subject: [PATCH v4 17/19] irqchip/loongson-pch-msi: Use irq_domain_create_hierarchy() Date: Mon, 16 Jan 2023 14:50:42 +0100 Message-Id: <20230116135044.14998-18-johan+linaro@kernel.org> X-Mailer: git-send-email 2.38.2 In-Reply-To: <20230116135044.14998-1-johan+linaro@kernel.org> References: <20230116135044.14998-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?1755187518939745972?= X-GMAIL-MSGID: =?utf-8?q?1755187518939745972?= Use the irq_domain_create_hierarchy() helper to create the hierarchical domain, which both serves as documentation and avoids poking at irqdomain internals. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Hsin-Yi Wang Tested-by: Mark-PK Tsai Signed-off-by: Johan Hovold --- 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,