Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1849341ybv; Sun, 23 Feb 2020 16:52:26 -0800 (PST) X-Google-Smtp-Source: APXvYqw3r/MvyLMPF/hJqMWQAMJmEaagREsRrPF3Q3veOMQ4GGX3jXTmh/fzne6X2rGyk6pUwt5G X-Received: by 2002:a9d:6a2:: with SMTP id 31mr37662421otx.313.1582505546454; Sun, 23 Feb 2020 16:52:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582505546; cv=none; d=google.com; s=arc-20160816; b=jMrvTXpdElq+OJmkJkyb+NQRAEr95xWgRnjqdSpQP+3uq3LCxPhW9d+FL7jYbZRQzl AGhUhHXm9SEjnyxaJRV2b319Bttbj9flRyJi3ta35Nm+TW8LI6X2H5fTLx+jgIV93Rj7 hkQpDQveU2eHZawkZojix6Nnv4Wz7DD3tUAvIRfZoH5vNvDDu7r79jIinKqK44SS/3m1 WlkruU4/fnoXj15IcLxM9TcHxFpXvluAZNiYX/sjb7uHykolY2I+BgMkHNV7HQPPkUMd ylmPhgAzGncPkOcvUS63Da2UG8XXmg9JvpXxXqfd8z48A487yYFvAzFbNI01UI95RJtf WH8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BfP9k/NNwFafc82qdK4A43141L4N4A8c31D/jiyN+s0=; b=MauTSKTY9Ln4gIi86dGWrrnWJRdcpYkqmbbg+/cscfZHBe8nYXlx0Md0ry+Z6wsE5Z 2b4qkOcTLnadYIrHvH0nGfhoxpIKSKJ6UHVk5i1SjYXUwFgduGLd4V9i35hLiNrETPRG qfOv+5n6xq17STH949JWqbNeBFCxlO7/Nl/yVyhOo+4oRt/jgfGYxklT+eUssyfd6ig3 Juus/PQo7Xi6N/H4YHzP771Lk28ezv3b0cBQ7rxjHjWO9FlOQnYbFtKWQVComJgw7sWq dtl5K2zyXxchs9IV9D5uAtA5DiaH313ZuOEC7DBQia7s5H8NZa2xwZDDXdwIycGGoMqf G+/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZgJT3Lu0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si5310758ota.204.2020.02.23.16.52.14; Sun, 23 Feb 2020 16:52:26 -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=@gmail.com header.s=20161025 header.b=ZgJT3Lu0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727311AbgBXAv7 (ORCPT + 99 others); Sun, 23 Feb 2020 19:51:59 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33334 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727165AbgBXAv7 (ORCPT ); Sun, 23 Feb 2020 19:51:59 -0500 Received: by mail-pg1-f194.google.com with SMTP id 6so4238886pgk.0; Sun, 23 Feb 2020 16:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BfP9k/NNwFafc82qdK4A43141L4N4A8c31D/jiyN+s0=; b=ZgJT3Lu0BRzVIGlbYzrVqjSwYTAsbxfHvIR0AZx5AkEGbDhD+cOM30XVdjkCS7m52S rzMUO21YaUpToJJ0MiVCovugW1NHLq3w+6Pv4qkp1Y9HlNWDXT/wavB8No1UsC4uNp5c VCgifQfwD99BCYErZoOmiZ3UrUt0wNE5vU2fHKro394VcnMkPq2+O9CycL5uhTlVk/Fn p2KWCEG5kUfPr1iKmOvTtaItR2hRcNtpStQubCDtCQhHlpXRWnH2zUWRrSroBNFUwdxy yGSmkKK5aZchb7hu6zTIDGpgTnfPWYx8ZfBtiWO4JCi3bFozQ7FY7ltO1+uHdhNRyy6/ 9gIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BfP9k/NNwFafc82qdK4A43141L4N4A8c31D/jiyN+s0=; b=lwnb3TAVYS/bD4PCEXpfQGuCezgzYv6xeSq1gITUMT1WAsZNYxb6vJIJpud1p11Qsb 5gtD8fUh9msBNW2jv+5pq63ReVCycUf4OlibFVPi4KAuGcqffDE0a/Tvjx7wa+oOTu4H neMv+kP2q8HO4grl6TXrvDevvGryqkV/eG35HeOvU+QP99GidaI3X4JrTazK4zHwtH5Z t/c2mSrLPM5a/5Mm60qwGrE6W09SegaswXLf7DZ6KatGavOzQhY9XeMsY6C2g2Bobife W7ZUu602hRul0Aml/RLWnBh5DvWr6FrdU4fcbspuP2aEP4ABUkNVZTv7h4novbLCNXYx sOQQ== X-Gm-Message-State: APjAAAU2f4yphjKNVkUHTnUyCt2wP4j8gJrdI29IpuJ1RcAGVmAxXVQh kwpS+LPyHf/0BU3+K1JsGMROXA+Yzn4= X-Received: by 2002:a63:8ec9:: with SMTP id k192mr9022967pge.293.1582505518469; Sun, 23 Feb 2020 16:51:58 -0800 (PST) Received: from localhost ([106.51.232.35]) by smtp.gmail.com with ESMTPSA id h10sm10165737pfo.181.2020.02.23.16.51.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Feb 2020 16:51:58 -0800 (PST) Date: Mon, 24 Feb 2020 06:21:56 +0530 From: afzal mohammed To: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yoshinori Sato , Rich Felker , Thomas Gleixner , Arnd Bergmann Subject: [PATCH v2 12/18] sh: replace setup_irq() by request_irq() Message-ID: <331ffab9c0b56f9c6d1b7f6afdb9c95ab285402c.1582471508.git.afzal.mohd.ma@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org request_irq() is preferred over setup_irq(). The early boot setup_irq() invocations happen either via 'init_IRQ()' or 'time_init()', while memory allocators are ready by 'mm_init()'. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq(). [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed --- v2: * Replace pr_err("request_irq() on %s failed" by pr_err("%s: request_irq() failed" * Commit message massage arch/sh/boards/mach-cayman/irq.c | 18 ++++++------------ arch/sh/drivers/dma/dma-pvr2.c | 9 +++------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c index 3b6ea2d99013..57d015f3c075 100644 --- a/arch/sh/boards/mach-cayman/irq.c +++ b/arch/sh/boards/mach-cayman/irq.c @@ -40,16 +40,6 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id) return IRQ_NONE; } -static struct irqaction cayman_action_smsc = { - .name = "Cayman SMSC Mux", - .handler = cayman_interrupt_smsc, -}; - -static struct irqaction cayman_action_pci2 = { - .name = "Cayman PCI2 Mux", - .handler = cayman_interrupt_pci2, -}; - static void enable_cayman_irq(struct irq_data *data) { unsigned int irq = data->irq; @@ -149,6 +139,10 @@ void init_cayman_irq(void) } /* Setup the SMSC interrupt */ - setup_irq(SMSC_IRQ, &cayman_action_smsc); - setup_irq(PCI2_IRQ, &cayman_action_pci2); + if (request_irq(SMSC_IRQ, cayman_interrupt_smsc, 0, "Cayman SMSC Mux", + NULL)) + pr_err("%s: request_irq() failed\n", "Cayman SMSC Mux"); + if (request_irq(PCI2_IRQ, cayman_interrupt_pci2, 0, "Cayman PCI2 Mux", + NULL)) + pr_err("%s: request_irq() failed\n", "Cayman PCI2 Mux"); } diff --git a/arch/sh/drivers/dma/dma-pvr2.c b/arch/sh/drivers/dma/dma-pvr2.c index b5dbd1f75768..0e5aa558a5f2 100644 --- a/arch/sh/drivers/dma/dma-pvr2.c +++ b/arch/sh/drivers/dma/dma-pvr2.c @@ -64,11 +64,6 @@ static int pvr2_xfer_dma(struct dma_channel *chan) return 0; } -static struct irqaction pvr2_dma_irq = { - .name = "pvr2 DMA handler", - .handler = pvr2_dma_interrupt, -}; - static struct dma_ops pvr2_dma_ops = { .request = pvr2_request_dma, .get_residue = pvr2_get_dma_residue, @@ -84,7 +79,9 @@ static struct dma_info pvr2_dma_info = { static int __init pvr2_dma_init(void) { - setup_irq(HW_EVENT_PVR2_DMA, &pvr2_dma_irq); + if (request_irq(HW_EVENT_PVR2_DMA, pvr2_dma_interrupt, 0, + "pvr2 DMA handler", NULL)) + pr_err("%s: request_irq() failed\n", "pvr2 DMA handler"); request_dma(PVR2_CASCADE_CHAN, "pvr2 cascade"); return register_dmac(&pvr2_dma_info); -- 2.25.1