Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp503093ybx; Fri, 1 Nov 2019 06:55:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOeYZRcNHiDTC0m5QhjFAhiBYROycsjAAGR5/TZvziQJ1kQgBqwcPuvz3bGDaGjfSGYdVU X-Received: by 2002:aa7:cb53:: with SMTP id w19mr8284702edt.50.1572616542321; Fri, 01 Nov 2019 06:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572616542; cv=none; d=google.com; s=arc-20160816; b=U1S91Q2gyqyB8uPxVvWbdYJBsiEIxUPN20FeCWfXLBAkKq0jmHZvRcvjmLfR2zYyB9 mE5QlHQDCvVqzLpiwKGTWz6QEK2QKdxXg1qMRQe9jOe1wZflR46MXMcbLbUtY4VH3Z1a VGatR6SSNw6xUIs32koiVgbwWLbqtrH4wWcG2QmbQATNX4ocHuFn9NrPCAgTwktMTWEf RA8QQFFFi20txzkMr7yxmr4C7y7PQ2oC9OnpIRvnXNkPHHysslWvXiBMM72HvDHRrK02 mHdKjSB3GGyGZ6myVw3LXmzGiZAJ4HODjCvvj8ZxSjo0jZc4a7kRdHTF5OFAzl8swL6M kyEA== 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=E9MniY1Iee5HGhOe/xollIck0/KPXWyQbXSm1b3gOvo=; b=qxWnqxetHCQb5n71TUuhx0joqzUBiwTbiRrc7gorxz5fhDeA2Xet649ZjNL7IW6Ch7 sBEcHCvRHb2W9a1mEB1qs07TY51kKXZolXckW1DlW+/j9Ba8RrYUWb+ZuunrnGpLGGd1 IdBN8YBz1emdt4OniFrVf6MqtIWcCzAyx59xGfHa+QgiVB/hCZ5RIId9fOkcn21wNhmy wP0Hqj15GpxkYK/Ytq+BcVNM1gxM+xw7/MQdcNE1A/7KlXikNqJ6dJ8LXLPSnWA7mz7r QkJroYfi38IkflJGwHIg/Txib7KEpof5U/L4w6nkDo0u5kBKbPlMco5tGeNG8smb2OJQ zoLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=IpmsnlU3; 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 j11si446882edj.43.2019.11.01.06.55.18; Fri, 01 Nov 2019 06:55:42 -0700 (PDT) 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=IpmsnlU3; 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 S1730741AbfKAMmm (ORCPT + 99 others); Fri, 1 Nov 2019 08:42:42 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34673 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730716AbfKAMmk (ORCPT ); Fri, 1 Nov 2019 08:42:40 -0400 Received: by mail-lj1-f193.google.com with SMTP id 139so10156163ljf.1 for ; Fri, 01 Nov 2019 05:42:38 -0700 (PDT) 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=E9MniY1Iee5HGhOe/xollIck0/KPXWyQbXSm1b3gOvo=; b=IpmsnlU3N0uY5wGR42rpGKBUHIRdnp8kSvWptnZoSOs8mgvM/MGv2oWAk9GnohesvQ 9Mgw5KFKbVbmDGlPWX0bPgsWWQcgXnUUa09RONfmY7iCiPIB65NKAk7QExrVUAdDtR8I prVxqK2LpIewYWoHxk7rhieBimU/nQgdSay7A= 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=E9MniY1Iee5HGhOe/xollIck0/KPXWyQbXSm1b3gOvo=; b=evaSnS3WrnRS9BuZ69LCV6otzcDDSjLwP4+9soCzNqG6l0qcEEOfSYBDtYL0fJXWZQ 2RDkyl3Zq1caP/YgPciPGEhnXpYpLUE5xE87yoFe+YFuRpyQD8tDvZ+EyVn682vO4J7+ AXK5dwIb8XOz4suO8xDqY4KsCHRnBYKQqIJKZFA8BVSYxZCqmWG0H7x7TZvkIyfDgjVD vdL2jqZwVz67zIUmbg68JdiDt1R26nNoUIdajz0ByufatEJFasCJ4+CVucxVFDaauGXY 9i05TA/3c8Cdeocfx774Gs16SDkUztDqYwpfYWR4DmPmIk15neNGXHvDDstlEWud/r/n uxsA== X-Gm-Message-State: APjAAAWOwF0pstj2vjS1YMLAhqMyWHIBTqrh7WSbAEbjLt1l0qhDHDiM CwzvJivxkZJYOYkl2LuIUcxy7Q== X-Received: by 2002:a2e:99c2:: with SMTP id l2mr2450641ljj.145.1572612158179; Fri, 01 Nov 2019 05:42:38 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id o26sm2458540lfi.57.2019.11.01.05.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 05:42:37 -0700 (PDT) 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 , Rasmus Villemoes Subject: [PATCH v3 18/36] soc: fsl: qe: don't use NO_IRQ in qe_ic.c Date: Fri, 1 Nov 2019 13:41:52 +0100 Message-Id: <20191101124210.14510-19-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101124210.14510-1-linux@rasmusvillemoes.dk> References: <20191018125234.21825-1-linux@rasmusvillemoes.dk> <20191101124210.14510-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. 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