From patchwork Mon Jan 16 13:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 44163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1202818wrn; Mon, 16 Jan 2023 05:54:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXtePmRDVGoJ0FgsE6knVXLr6IADbZssQvfs/hFWKysEpIzAEbIuVPwZisdNrYs+H4LBqSeK X-Received: by 2002:a17:906:714b:b0:7c0:e98d:b27 with SMTP id z11-20020a170906714b00b007c0e98d0b27mr12836408ejj.58.1673877257299; 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=f/ffWp6QXqMSRk93UGA44wgSbofJ96Yo6rQJ3z3m4hHaQOWL+gZYlrLgAMNi+sPgS2 BaxEwGwC8ZlralZY5CiLy6c7RJEkH/4rP9TGwwm37s0wsWp2Zcyh9QObLId7vCJNpANb KWFQLg7LBl+98tGTVd/NYiyYpX4+GekMpk946sjzye9MY/QqQQ7litspQMV4d5Ac8RJ7 AaMoF9CBlr1hx+KwZ0+6NEpRFwWu5BZW0o8NH2Vg67k0yPThi3xNQTBlKUKpwB1wcWRo KIL3Yu3ZQYwEa1nTTa7XrqwolBT3kZJfh9aX8OCpF+/b+yrk3CGyKUtCpb/OfaMrEBWt 4mOQ== 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=QAgcHc0KsgxNN6egKVBrPnXpdcEG2tK9d/3SyvW1grE=; b=Gqa+ZdVMsCP2DSkP+F75Tt9Gv3gi4B8WeLb7Mgh9fLbrXH5s6K4mzcvyNkk2wbw2DM dCuE29K34gffkUPnY98JF0aBCXFE0k/e+DsviYep2JjKtYmddGdzoSBiRrrWNzZZQQdZ BeYVeyp4MkkTJ0lbpw0V9REHClZrmiO1qVXa8Q1rRcjfpDlmlAAUXbokUD5Vr8Iu7Ert l0ZpNDP/gA0McOx4LXK1CtCjGQfTlBaWGMd25hlNp64rvwZv8Ht4Eg9ho6zaur5ps2Fs 0jfWOePb2OQj6OC+pL8+7XlhvhjbkSZDVfAQYDgy/kYYjfFrMpy9EN8Ow5KcFkV8kSw0 uJTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lbf7fa2t; 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 ae2-20020a17090725c200b007c0dcc41dbcsi26246931ejc.821.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=lbf7fa2t; 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 S231156AbjAPNv3 (ORCPT + 99 others); Mon, 16 Jan 2023 08:51:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231543AbjAPNup (ORCPT ); Mon, 16 Jan 2023 08:50:45 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 777C021A0C; Mon, 16 Jan 2023 05:50:43 -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 47FB560FE1; Mon, 16 Jan 2023 13:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B443DC4322E; 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=nlxLr7M1e3sPAGKO79refaH63FrFXT94UU3Vpzwqemc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lbf7fa2tZbpeVfBK6+e27SiZIYIPL1Naxz33L0nLt84RxNJ1hoR39PrisqR1X/37R 33TOcM/FZ8iEdZ4mfOYSVj6Wl7wgUscP71KunXbpaLF2ufmxP7zqAFWKoqrN6L1vet T/JwIxIMq+1GBMOWcgof6EKvwiZBKL4ud3N3LJqz9iBHmZ4E8XpXHXrMeWjxOC6GZb 0rLron/ZW1/2GqYdXR/t49omPmZzwfjx7EUnkD82sIDkr7vKx23oWcoPgnZaS50oaM 5PR1it7wREqawHTHchbYwXtlr8kNUPqkotI5Wxf+cSc0izc60QweYgk89cHLmFOkgW Df47QkoVuUghA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pHPt7-0003vX-2z; 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 18/19] irqchip/mvebu-odmi: Use irq_domain_create_hierarchy() Date: Mon, 16 Jan 2023 14:50:43 +0100 Message-Id: <20230116135044.14998-19-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?1755187518906075774?= X-GMAIL-MSGID: =?utf-8?q?1755187518906075774?= 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-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);