From patchwork Fri Dec 9 14:01:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 31764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp795219wrr; Fri, 9 Dec 2022 06:07:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7jWNV5a+wi9/1wP5pZRDB9+UgsQBPpB+AqQie9PWZjJMZfrqPrH3nZ7H5pNAESRIIeQrP9 X-Received: by 2002:a62:18c6:0:b0:575:fdb6:8e55 with SMTP id 189-20020a6218c6000000b00575fdb68e55mr5470758pfy.7.1670594866051; Fri, 09 Dec 2022 06:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670594866; cv=none; d=google.com; s=arc-20160816; b=sSfWGHQd2rvzjtWNH6yVbnnr3s66DFA0p9+b+igSKsZhtcnZcFmbcWQr+yOV9+8sHv WsaYQTf6LaR8QLdEEYXlH/40b76+ayDd1kEEFYD87ggXY5sN7iePV6eGK9VMaJmg3afk /5PYVJWd2BJJZcZUYmAAJiLM1BO7zv0cAn7WQqcv6cT97lq9E3eyTUbvcrUWtri2yFlm swEvaHbPGElkD1dGIwOUCmt7MVF0Ys4hbJ4miEQ7GBEIuR2wUI1OjGsgqD3uVKsaaNjr qOGANoN3OgLkf4jZYt+s+sCiBTFXLHC3n3ZDm764JUJgyXIXCou3PDWqkJQ/HHepYO// oJYQ== 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=hx9oSguu0EFl0P+a2HocVZ43pPDMXuJPdjEMGmJgOWs=; b=eC5YIFvyq6g3bLLvnT4g+gjTD4hf8XpVDi4YUSiaMnIk9YuyUOOAHiYLQ75/PDMzi8 jGndRYGrW0tV1gxbnRA9k9QG6us4972U/qtdDOX+QG0iASZ5YzPJIxV5sdlHBEcD6ZtQ TWQM0NUucUCnLdC+yW+ZCDzN+LAcU6PskLqiaKUFHgYoibwfvO+czKuRE0oPlUnl7p4k bEPboihGVMacKQ0660qumnI4u7/FwqJC6OO12k2sprKQy2jHZKesoytZifIx/QCrVhxy 3yCW/oQtfrmvePKrOlkVi0CSLBC9Vv8je4uEn55ByElp3IPDoN5eRz3GisAmpImmEh/v BuPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vBPCGJ3y; 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 c14-20020a056a00008e00b0056bbdb48fcdsi1728816pfj.118.2022.12.09.06.07.30; Fri, 09 Dec 2022 06:07: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=vBPCGJ3y; 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 S230193AbiLIOGc (ORCPT + 99 others); Fri, 9 Dec 2022 09:06:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbiLIOFV (ORCPT ); Fri, 9 Dec 2022 09:05:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD1A176143; Fri, 9 Dec 2022 06:05:19 -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 26115B8288B; Fri, 9 Dec 2022 14:05:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86F9DC432C7; 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=VZG0mIrnpRYSLmP6v+aPSsXqssZN+JxVOB0YXZxJtgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vBPCGJ3ydqDKIQkyQiwvx3XBhQ8eYOJI6wjL7rjJduxKvPdzdS5X9EDTcy8k6PxC5 r2hMYtQ9BPJ38yd40f/xppo09a5tY54ooaCwgv7bHH17qds/lSpnelHcNAThBeuhz/ BrjSw3OEW9PtnBWPMuErakJhKSnTpv80Bhu0T8z2VQr2n8I3BcENT58IDq8oT3n6n1 tTRDCz/w4Ra6GZ99RJmFy8Jv1kiZqdKtmbldZW9z01mSQohFyIF2INRmpczT8jgrZz Z0gTo7WjVwGW5u9NI6AhHt2Jgp4Dh0CnSQTmD8OJ6yRG7UYz6t6F6Ux+of7yFXakxf EI6muweRqyVcg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p3e0J-0000SD-QA; 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 18/19] irqchip/mvebu-odmi: Use irq_domain_create_hierarchy() Date: Fri, 9 Dec 2022 15:01:49 +0100 Message-Id: <20221209140150.1453-19-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?1751745681879229381?= X-GMAIL-MSGID: =?utf-8?q?1751745681879229381?= 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-mvebu-odmi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c index dc4145abdd6f..108091533e10 100644 --- a/drivers/irqchip/irq-mvebu-odmi.c +++ b/drivers/irqchip/irq-mvebu-odmi.c @@ -161,7 +161,7 @@ static struct msi_domain_info odmi_msi_domain_info = { static int __init mvebu_odmi_init(struct device_node *node, struct device_node *parent) { - struct irq_domain *inner_domain, *plat_domain; + struct irq_domain *parent_domain, *inner_domain, *plat_domain; int ret, i; if (of_property_read_u32(node, "marvell,odmi-frames", &odmis_count)) @@ -197,16 +197,17 @@ static int __init mvebu_odmi_init(struct device_node *node, } } - inner_domain = irq_domain_create_linear(of_node_to_fwnode(node), - odmis_count * NODMIS_PER_FRAME, - &odmi_domain_ops, NULL); + parent_domain = irq_find_host(parent); + + inner_domain = irq_domain_create_hierarchy(parent_domain, 0, + odmis_count * NODMIS_PER_FRAME, + of_node_to_fwnode(node), + &odmi_domain_ops, NULL); if (!inner_domain) { ret = -ENOMEM; goto err_unmap; } - inner_domain->parent = irq_find_host(parent); - plat_domain = platform_msi_create_irq_domain(of_node_to_fwnode(node), &odmi_msi_domain_info, inner_domain);