Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2055343rwl; Sat, 8 Apr 2023 07:03:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bXNmIPfYyzIfxm0sdtVE7VpQbpUIWDnxodCjvTqB3aB6MziQSa67p7my5w8hHMScInx5JJ X-Received: by 2002:a17:902:cec8:b0:1a5:eb:9d3f with SMTP id d8-20020a170902cec800b001a500eb9d3fmr7248117plg.56.1680962612395; Sat, 08 Apr 2023 07:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680962612; cv=none; d=google.com; s=arc-20160816; b=N7No2M6EWXyU6/UDqbM2zHHkIHW3IK9ec9ECQf+x5bspHYhpe6nZ1u2+jZz9RDVo/L Bw81rcoAvrYfiqUEHIarc9jtCHEl41K+stg3+h8TKEqwiB/Ttg6ywDO7Aobvhpq8E8La XjtkSRoC+KRVwlx4dMh9p0oFphE84AkGRtCNXhYp3kws+/4E39S+UshFUZSGkbg2VAjM SsOdc6fwjb8PU33NBtyo9YNSosPddEzcBT/qIX3E5N5nD/Id7WCs1IEMbMMXDEOt6we5 +OBBEitcB01EsSkAqkMvMnanphHYnCXcdVYiqhSY2nE+AreQU6SYI+1ZcsPcNsT+SI1c nQ/Q== 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=/1vpvubavBSyVGidKcdknStxOcjoTeeHq/6CZ6Ur3iA=; b=I2gcKf55NofPqXnQZaNyVnS1oWQynrpxxg+UlDKNpkbCweqFUBrLHd0h7Y+m+WAIY1 9yyoXGGLAq5fBQltQD2yTGW2FeE5J7bcVT6iTAjM2QGLNg1JW51vtwaUtSZ/D/agBKoy ib2DhZXhEwFSvuZWgRbYFbZOrks7HMsCsvyVFMy9FGW0oH/ANNUl3k/WP6PpSKBlVCyt qFkzzoqXDgCxH5TsJ0ILDAe82r3AVy55jFnW3XM1Vd7t8rtb9MljvtgOwLXfSTtkbdrY Zd/u9XokgbiPJ3+v77Atm0yUmyCm+G+XZYnZxJhAicEzpLzv1Yf5EkvT+Mp7LBqRnx5i /2rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d63wSgO8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a170902f54c00b001990520ebccsi6582097plf.587.2023.04.08.07.03.11; Sat, 08 Apr 2023 07:03:32 -0700 (PDT) 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=d63wSgO8; 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 S230073AbjDHOCu (ORCPT + 99 others); Sat, 8 Apr 2023 10:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjDHOCh (ORCPT ); Sat, 8 Apr 2023 10:02:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE582EF96 for ; Sat, 8 Apr 2023 07:02:34 -0700 (PDT) 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 5656861596 for ; Sat, 8 Apr 2023 14:02:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92FCCC433A1; Sat, 8 Apr 2023 14:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680962548; bh=Rp++EnLZvDWAyB3q+nRICzltKHVA/IpPx8P+WV9axbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d63wSgO8NZTCjjxPXd+AmDEIQe+gyDYiMgcKB8PSi4WpJqpieDf5zMXaM0MXknU3H hNvoseYGoWP+XqUj9z05uG/IRYTB6bjtf++dRdJ0QWv9zcxbCiE3PIFrYxmI8pHKAK xEQt3+R4OuIta+Dtbh2cSfbrfRQTdau7nhXXoFCFrqRFh3FDBb0fZbH/jTvWF6Sn6u po2epwl+rSDUnJ62BpssBUkJ+s4DGZ3YbeQ8q+xOtkBkhs8PWLuXVyAmRNtfcXsh9N rAVMWtCNFp8jq7mZDr7D2FLJoAuhLu/djyHxdS/+tFCP03/vCA4rlxOH3xf93knNFp dLxyieFTLfNYw== Received: by pali.im (Postfix) id 66F7D20A8; Sat, 8 Apr 2023 16:02:26 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Christophe Leroy , Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 05/13] powerpc/85xx: Remove #ifdefs CONFIG_PPC_I8259 in mpc85xx_ds Date: Sat, 8 Apr 2023 16:01:14 +0200 Message-Id: <20230408140122.25293-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230408140122.25293-1-pali@kernel.org> References: <20230408140122.25293-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 From: Christophe Leroy All necessary items are declared all the time, no need to use a #ifdef CONFIG_PPC_I8259. Refactor CONFIG_PPC_I8259 actions into a dedicated init function. Signed-off-by: Christophe Leroy Signed-off-by: Pali Rohár --- arch/powerpc/platforms/85xx/mpc85xx_ds.c | 37 +++++++++++++----------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index d8d13438e18f..4ae300e76c2d 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c @@ -34,7 +34,6 @@ #include "mpc85xx.h" -#ifdef CONFIG_PPC_I8259 static void mpc85xx_8259_cascade(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); @@ -45,29 +44,16 @@ static void mpc85xx_8259_cascade(struct irq_desc *desc) } chip->irq_eoi(&desc->irq_data); } -#endif /* CONFIG_PPC_I8259 */ -void __init mpc85xx_ds_pic_init(void) +static void __init mpc85xx_8259_init(void) { - struct mpic *mpic; - int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU; -#ifdef CONFIG_PPC_I8259 struct device_node *np; struct device_node *cascade_node = NULL; int cascade_irq; -#endif - if (of_machine_is_compatible("fsl,MPC8572DS-CAMP")) - flags |= MPIC_NO_RESET; - - mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC "); - - if (WARN_ON(!mpic)) + if (!IS_ENABLED(CONFIG_PPC_I8259)) return; - mpic_init(mpic); - -#ifdef CONFIG_PPC_I8259 /* Initialize the i8259 controller */ for_each_node_by_type(np, "interrupt-controller") if (of_device_is_compatible(np, "chrp,iic")) { @@ -92,7 +78,24 @@ void __init mpc85xx_ds_pic_init(void) of_node_put(cascade_node); irq_set_chained_handler(cascade_irq, mpc85xx_8259_cascade); -#endif /* CONFIG_PPC_I8259 */ +} + +void __init mpc85xx_ds_pic_init(void) +{ + struct mpic *mpic; + int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU; + + if (of_machine_is_compatible("fsl,MPC8572DS-CAMP")) + flags |= MPIC_NO_RESET; + + mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC "); + + if (WARN_ON(!mpic)) + return; + + mpic_init(mpic); + + mpc85xx_8259_init(); } /* -- 2.20.1