Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6880556ybc; Thu, 28 Nov 2019 07:04:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwwKPnwbvSZ3O6PTOo75/qGnMAbTBYXh1VdDWbJkKTyb2vrvgZ2gXUZwOOSNHJ/ZwI1mn0B X-Received: by 2002:a05:6402:13d8:: with SMTP id a24mr6546028edx.64.1574953477347; Thu, 28 Nov 2019 07:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953477; cv=none; d=google.com; s=arc-20160816; b=RdiBYqW8WM4h22/UmQoMb5z4zWhXAwAAsPVvcDi52VmMJgaA0mJknjdJ1yfKaenprb jp4KOMuU90puvE49qgzV7Av9A8DacqBWU2czkQ0QEw/l0p0O545i9fZfg/ZjW/xknqTd I2YvFqX1LlbBgcuWvBn9us+wNk96HlOA++ZPtC+7x+mX2na7c3/S9Lu47wBrXIReAFok 513eifMeIL3C7E3sFJ9+EEvM2hJs3AtRWw1vVKJXbUyps6VLkWIMwi+oKQSFhNwfHUjw MhmynRoD4bZK6qL86a1t/i0PhSo8psUDFTy0uEsuLPSwhrJlI1Dwm+kWt1mVeKA1KbPK v0QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mtd6KOe5C+lXXzTDTBlFpDdo3Tux736e7umhIFFeQrE=; b=jiN1WkVcSdpA1mxDvRuFRPUVAI905h2UMzhk+6IgkE0pZEGNCpANXop3JU7YUN5VRs L5twvXqAts93kG1Q2HAYEvGWhHSAMM3KsDz7sN2GW66P3c4FghRvdVKW9woXxzb0fIqB s7kAG5BGb8767b2M0Oqkm25ZKcOGI+zeV18NPEgpMOlcZCFtNVViBNBVZx0kHgK63S4o KCB9TWb6E7p4+bqlFex26eP1CuTdCnv5csDcssq6Cryhgx6G8Kh0lcl3BNbUQMfN3PUA SX1CKq4uPqqN6wN1v+ac+Nn0T9OZ9/EMnBGoFaZVI4aCR6bYcabM1gfe2uOSwGQkXRWp sAGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="bh/RnMHA"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10si15182306edj.316.2019.11.28.07.04.12; Thu, 28 Nov 2019 07:04:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="bh/RnMHA"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbfK1O7l (ORCPT + 99 others); Thu, 28 Nov 2019 09:59:41 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:36680 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727345AbfK1O5b (ORCPT ); Thu, 28 Nov 2019 09:57:31 -0500 Received: by mail-lf1-f67.google.com with SMTP id f16so20274122lfm.3 for ; Thu, 28 Nov 2019 06:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mtd6KOe5C+lXXzTDTBlFpDdo3Tux736e7umhIFFeQrE=; b=bh/RnMHAteQn3+TRW38L+F8X+ONzQFjPIEG2JvTYv+9jVRbxGvJJGWX3sxEeU25TGQ 1PkR2s4jhvRALRiQl9WgbtjhkyrjTSS4F5Tl9wXQau8QxtF6Nnjv57oPrnzcO0NyPV94 Xjkyrg5UdwonuCitU/qx8RgfbT/w/e2N7LjzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mtd6KOe5C+lXXzTDTBlFpDdo3Tux736e7umhIFFeQrE=; b=nXc/0Ch5OEShhOFTW6/usdYE2+NIC11wWek2KnPEbttTkaXG6NVBIRe0YyJumY7YmJ 3FCI+zTdHBCfkm5loIRpinGKHmIjYnxR9NCLFNFBK5Dzj0515lf3pYLDeAFiO5H9sYIp Tv9MKkUMcQFl8ZOZDomGLl9u/thvw3tyCnuj8RH6FPPMXb+svV73TEfStIGGuR9qA0J6 t2W7ZMfucLKkt4gxsZ8SwXuZBSVn+T5Egn72JKfcjbW/lY5TwI1zHpdnOwC+FwwTXKvt iWMIgrZ9u1M3Trd4TFpGuu1DQq7x3LEHEcwDybKMVlSQPpMdGCcELywuZA1toT0qCo+H YKdw== X-Gm-Message-State: APjAAAW3Yl5Nt59VfHDrv2t6ck2Kw0bSop9tVz0rsib67jJ8Xumq8FwT H0K0/hqd74ivaukIPOua8vLTQw== X-Received: by 2002:a19:cc08:: with SMTP id c8mr32133620lfg.124.1574953048402; Thu, 28 Nov 2019 06:57:28 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id u2sm2456803lfl.18.2019.11.28.06.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:27 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Timur Tabi , Rasmus Villemoes Subject: [PATCH v6 18/49] soc: fsl: qe: don't use NO_IRQ in qe_ic.c Date: Thu, 28 Nov 2019 15:55:23 +0100 Message-Id: <20191128145554.1297-19-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128145554.1297-1-linux@rasmusvillemoes.dk> References: <20191128145554.1297-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This driver is currently PPC-only, and on powerpc, NO_IRQ is 0, so this doesn't change functionality. However, not every architecture defines NO_IRQ, and some define it as -1, so the detection of a failed irq_of_parse_and_map() (which returns 0 on failure) would be wrong on those. So to prepare for allowing this driver to build on other architectures, drop all references to NO_IRQ. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c index 4839dcd5c5d3..8f74bc6efd5c 100644 --- a/drivers/soc/fsl/qe/qe_ic.c +++ b/drivers/soc/fsl/qe/qe_ic.c @@ -282,7 +282,7 @@ static const struct irq_domain_ops qe_ic_host_ops = { .xlate = irq_domain_xlate_onetwocell, }; -/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ +/* Return an interrupt vector or 0 if no interrupt is pending. */ unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) { int irq; @@ -293,12 +293,12 @@ unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) irq = qe_ic_read(qe_ic->regs, QEIC_CIVEC) >> 26; if (irq == 0) - return NO_IRQ; + return 0; return irq_linear_revmap(qe_ic->irqhost, irq); } -/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ +/* Return an interrupt vector or 0 if no interrupt is pending. */ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) { int irq; @@ -309,7 +309,7 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) irq = qe_ic_read(qe_ic->regs, QEIC_CHIVEC) >> 26; if (irq == 0) - return NO_IRQ; + return 0; return irq_linear_revmap(qe_ic->irqhost, irq); } @@ -320,7 +320,7 @@ static void qe_ic_cascade_low(struct irq_desc *desc) unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); struct irq_chip *chip = irq_desc_get_chip(desc); - if (cascade_irq != NO_IRQ) + if (cascade_irq != 0) generic_handle_irq(cascade_irq); if (chip->irq_eoi) @@ -333,7 +333,7 @@ static void qe_ic_cascade_high(struct irq_desc *desc) unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); struct irq_chip *chip = irq_desc_get_chip(desc); - if (cascade_irq != NO_IRQ) + if (cascade_irq != 0) generic_handle_irq(cascade_irq); if (chip->irq_eoi) @@ -347,10 +347,10 @@ static void qe_ic_cascade_muxed_mpic(struct irq_desc *desc) struct irq_chip *chip = irq_desc_get_chip(desc); cascade_irq = qe_ic_get_high_irq(qe_ic); - if (cascade_irq == NO_IRQ) + if (cascade_irq == 0) cascade_irq = qe_ic_get_low_irq(qe_ic); - if (cascade_irq != NO_IRQ) + if (cascade_irq != 0) generic_handle_irq(cascade_irq); chip->irq_eoi(&desc->irq_data); @@ -386,7 +386,7 @@ static void __init qe_ic_init(struct device_node *node, unsigned int flags) qe_ic->virq_high = irq_of_parse_and_map(node, 0); qe_ic->virq_low = irq_of_parse_and_map(node, 1); - if (qe_ic->virq_low == NO_IRQ) { + if (!qe_ic->virq_low) { printk(KERN_ERR "Failed to map QE_IC low IRQ\n"); kfree(qe_ic); return; @@ -423,8 +423,7 @@ static void __init qe_ic_init(struct device_node *node, unsigned int flags) irq_set_handler_data(qe_ic->virq_low, qe_ic); irq_set_chained_handler(qe_ic->virq_low, low_handler); - if (qe_ic->virq_high != NO_IRQ && - qe_ic->virq_high != qe_ic->virq_low) { + if (qe_ic->virq_high && qe_ic->virq_high != qe_ic->virq_low) { irq_set_handler_data(qe_ic->virq_high, qe_ic); irq_set_chained_handler(qe_ic->virq_high, high_handler); } -- 2.23.0