Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5795686ybv; Wed, 12 Feb 2020 00:05:19 -0800 (PST) X-Google-Smtp-Source: APXvYqw9yU6UodsUJJQffP5PsaY9r/6qQR0H3wDugKkMbJ+zDIQJHhTtmz+5G3ODOipdcACcrqhE X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr7728022otq.147.1581494719029; Wed, 12 Feb 2020 00:05:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581494719; cv=none; d=google.com; s=arc-20160816; b=k+hV+NKUHchJSTUbYbR6fv0wR0dQkuIT2i5wBitMKLG1Vd+3AnCTo62MSSql/3pPh1 C7lZl2YtyAMOrT6yfiy3BJuf0cgUihhp3nSxEQHGgbrlOR24P7Gii8vfmNcRO7PGqcuO AepTc8QPoAdA3tlleIi22UB+CZh30A6QJHDHSC1XMm6tHzZoIbk3oew/RxtV557CXtd7 EmH/Lc3UAUcIWLqyE2KQIh1/r5c7uKlAcq+Lk/AmzYPuMbp96R80EciVluzo2Cp7idCy 7BQumui8rwzXwo5SdCT/O39/+OJGfndVNvCxjo6XuEybLp4xPp+p68JIOTdnbW2Tzsjf Ik4A== 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=wEZlgFm4FNfzz/lXt6jpAfiPKuyVHar0QeF+K8/f4Pg=; b=0gd9au5iNUKbRSLi5Lh7nTrYf/aDU7aQhn+fAqpF1o1JKXACn0VBjMSEQSn7WPnTmc Mq3qeZyeDK4SeqcEjSSmhWcErwv3p4na5CX63QJQ1lpe6Da7cI35iOojpGecPImOnar2 jx5HDBsxtgJQoWCcUI/V3Jf4qrFF//RgzvFxGsfkT4d3Rz7Qju9nmTDyAxkdTOQIuCvK edt7W09s9Zor68aQKzeJsjjEEofnM4RzZOSH/HW91KRIWjGTXkPas/LawzNAPP5cVSLu VeUxUkYkyFPVf+sxQt9H8zZLmzBusJz31hap7AhyB7rsXPGb6Y0Pr1M9jczjb9HuT0nd JcXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=axKFYFpu; 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 j1si3261001otr.207.2020.02.12.00.05.03; Wed, 12 Feb 2020 00:05:19 -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=axKFYFpu; 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 S1728516AbgBLIDe (ORCPT + 99 others); Wed, 12 Feb 2020 03:03:34 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34021 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbgBLIDe (ORCPT ); Wed, 12 Feb 2020 03:03:34 -0500 Received: by mail-pf1-f194.google.com with SMTP id i6so850089pfc.1 for ; Wed, 12 Feb 2020 00:03:33 -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=wEZlgFm4FNfzz/lXt6jpAfiPKuyVHar0QeF+K8/f4Pg=; b=axKFYFpugWMCeCSbnL9lxqZCEt6U5PV2TyJ5/Gb2FFMk2gQw8aZoGAC53qBXNxPc+9 f0p5I8y10USvjuH/P3aUXX0TjgvM4vfN+fL22IGpLhPZi1dzavndMM5KwNqBHADcrq9u OSN24xNN806OmOwdY0r1q65IW96+GqiJ1ntJTxWIegT6tk1h/1IJwviDB0MC+178xKt0 aVUZEe+hYHACM+Qgjx/udYYdfgP9gEHS9jx3V3c2YMbo2oeBP0qWb/3yf98mwLOgBaM9 dfUQn8E0rJMhNyf/iW8L6xS+Jp1KTjiVz1+8WyStA48waiF0eSAK7dTpvGckxGLwflOG LUWA== 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=wEZlgFm4FNfzz/lXt6jpAfiPKuyVHar0QeF+K8/f4Pg=; b=hyCpgwH724pUuUhGafKnpCucQVgCEJEbBsoIm8IjikY4jA5utltqOrPe6OKlzS89dP c1jpuxKBmordCYjLN5V8Qv0u3GubQvk5Qjq6VyvWNDcB5TnAJEQHQIewShlDTdoxs/tz z6wybQE+lAS2Mn+oc2fIOQhJUOkFeCsU3H1QJbLSL5tV8zhjqGsqBq7noNmcSwlmixM1 Hko/CY6t+mq0bFvkjJSTmF5CGjs6adILZgZAhpvw2UOhdg+tJFbqKL542lXeBQADdZDe VJuk5bqi0V1/3wnmDEZaEgh1PcRxEWUtxstvcv0CT9yy9LV+tq5hcF0qCmFeuwKNVdVi lA5w== X-Gm-Message-State: APjAAAXMnpB9iBWx8yKq6BiFm3Kam15PZm3wpDl0bG3+F5jpGrsmyn8F OJEn7YfxQUfHKhw0eSai/v0= X-Received: by 2002:a65:43cb:: with SMTP id n11mr10874713pgp.65.1581494612586; Wed, 12 Feb 2020 00:03:32 -0800 (PST) Received: from localhost ([106.51.21.91]) by smtp.gmail.com with ESMTPSA id v25sm6870937pfe.147.2020.02.12.00.03.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:03:32 -0800 (PST) Date: Wed, 12 Feb 2020 13:33:30 +0530 From: afzal mohammed To: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Cc: Greg Ungerer , Thomas Gleixner , Geert Uytterhoeven Subject: [PATCH 06/18] m68k: Replace setup_irq() by request_irq() Message-ID: <1941c51a3237c4e9df6d9a5b87615cd1bba572dc.1581478324.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(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & '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 --- Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter, https://lkml.kernel.org/r/cover.1581478323.git.afzal.mohd.ma@gmail.com arch/m68k/68000/timers.c | 9 ++------- arch/m68k/coldfire/pit.c | 9 ++------- arch/m68k/coldfire/sltimers.c | 19 +++++-------------- arch/m68k/coldfire/timers.c | 19 +++++-------------- 4 files changed, 14 insertions(+), 42 deletions(-) diff --git a/arch/m68k/68000/timers.c b/arch/m68k/68000/timers.c index 71ddb4c98726..7a55d664592e 100644 --- a/arch/m68k/68000/timers.c +++ b/arch/m68k/68000/timers.c @@ -68,12 +68,6 @@ static irqreturn_t hw_tick(int irq, void *dummy) /***************************************************************************/ -static struct irqaction m68328_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER, - .handler = hw_tick, -}; - /***************************************************************************/ static u64 m68328_read_clk(struct clocksource *cs) @@ -106,7 +100,8 @@ void hw_timer_init(irq_handler_t handler) TCTL = 0; /* set ISR */ - setup_irq(TMR_IRQ_NUM, &m68328_timer_irq); + if (request_irq(TMR_IRQ_NUM, hw_tick, IRQF_TIMER, "timer", NULL)) + pr_err("request_irq() on %s failed\n", "timer"); /* Restart mode, Enable int, Set clock source */ TCTL = TCTL_OM | TCTL_IRQEN | CLOCK_SOURCE; diff --git a/arch/m68k/coldfire/pit.c b/arch/m68k/coldfire/pit.c index eb6f16b0e2e6..d09e253abe5a 100644 --- a/arch/m68k/coldfire/pit.c +++ b/arch/m68k/coldfire/pit.c @@ -111,12 +111,6 @@ static irqreturn_t pit_tick(int irq, void *dummy) /***************************************************************************/ -static struct irqaction pit_irq = { - .name = "timer", - .flags = IRQF_TIMER, - .handler = pit_tick, -}; - /***************************************************************************/ static u64 pit_read_clk(struct clocksource *cs) @@ -156,7 +150,8 @@ void hw_timer_init(irq_handler_t handler) cf_pit_clockevent.min_delta_ticks = 0x3f; clockevents_register_device(&cf_pit_clockevent); - setup_irq(MCF_IRQ_PIT1, &pit_irq); + if (request_irq(MCF_IRQ_PIT1, pit_tick, IRQF_TIMER, "timer", NULL)) + pr_err("request_irq() on %s failed\n", "timer"); clocksource_register_hz(&pit_clk, FREQ); } diff --git a/arch/m68k/coldfire/sltimers.c b/arch/m68k/coldfire/sltimers.c index 1b11e7bacab3..2188a21e5413 100644 --- a/arch/m68k/coldfire/sltimers.c +++ b/arch/m68k/coldfire/sltimers.c @@ -50,18 +50,14 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy) return IRQ_HANDLED; } -static struct irqaction mcfslt_profile_irq = { - .name = "profile timer", - .flags = IRQF_TIMER, - .handler = mcfslt_profile_tick, -}; - void mcfslt_profile_init(void) { printk(KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n", PROFILEHZ); - setup_irq(MCF_IRQ_PROFILER, &mcfslt_profile_irq); + if (request_irq(MCF_IRQ_PROFILER, mcfslt_profile_tick, IRQF_TIMER, + "profile timer", NULL)) + pr_err("request_irq() on %s failed\n", "profile timer"); /* Set up TIMER 2 as high speed profile clock */ __raw_writel(MCF_BUSCLK / PROFILEHZ - 1, PA(MCFSLT_STCNT)); @@ -92,12 +88,6 @@ static irqreturn_t mcfslt_tick(int irq, void *dummy) return timer_interrupt(irq, dummy); } -static struct irqaction mcfslt_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER, - .handler = mcfslt_tick, -}; - static u64 mcfslt_read_clk(struct clocksource *cs) { unsigned long flags; @@ -140,7 +130,8 @@ void hw_timer_init(irq_handler_t handler) mcfslt_cnt = mcfslt_cycles_per_jiffy; timer_interrupt = handler; - setup_irq(MCF_IRQ_TIMER, &mcfslt_timer_irq); + if (request_irq(MCF_IRQ_TIMER, mcfslt_tick, IRQF_TIMER, "timer", NULL)) + pr_err("request_irq() on %s failed\n", "timer"); clocksource_register_hz(&mcfslt_clk, MCF_BUSCLK); diff --git a/arch/m68k/coldfire/timers.c b/arch/m68k/coldfire/timers.c index 227aa5d13709..f384e92d8b1c 100644 --- a/arch/m68k/coldfire/timers.c +++ b/arch/m68k/coldfire/timers.c @@ -82,12 +82,6 @@ static irqreturn_t mcftmr_tick(int irq, void *dummy) /***************************************************************************/ -static struct irqaction mcftmr_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER, - .handler = mcftmr_tick, -}; - /***************************************************************************/ static u64 mcftmr_read_clk(struct clocksource *cs) @@ -134,7 +128,8 @@ void hw_timer_init(irq_handler_t handler) timer_interrupt = handler; init_timer_irq(); - setup_irq(MCF_IRQ_TIMER, &mcftmr_timer_irq); + if (request_irq(MCF_IRQ_TIMER, mcftmr_tick, IRQF_TIMER, "timer", NULL)) + pr_err("request_irq() on %s failed\n", "timer"); #ifdef CONFIG_HIGHPROFILE coldfire_profile_init(); @@ -170,12 +165,6 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy) /***************************************************************************/ -static struct irqaction coldfire_profile_irq = { - .name = "profile timer", - .flags = IRQF_TIMER, - .handler = coldfire_profile_tick, -}; - void coldfire_profile_init(void) { printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n", @@ -188,7 +177,9 @@ void coldfire_profile_init(void) __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 | MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, PA(MCFTIMER_TMR)); - setup_irq(MCF_IRQ_PROFILER, &coldfire_profile_irq); + if (request_irq(MCF_IRQ_PROFILER, coldfire_profile_tick, IRQF_TIMER, + "profile timer", NULL)) + pr_err("request_irq() on %s failed\n", "profile timer"); } /***************************************************************************/ -- 2.24.1