From patchwork Fri Mar 27 12:44:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: afzal mohammed X-Patchwork-Id: 11462343 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D43F481 for ; Fri, 27 Mar 2020 12:44:15 +0000 (UTC) Received: by mail.kernel.org (Postfix) id CDFAE2082E; Fri, 27 Mar 2020 12:44:15 +0000 (UTC) Delivered-To: soc@kernel.org Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A07C4206F2; Fri, 27 Mar 2020 12:44:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q2Otw0ip" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A07C4206F2 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=afzal.mohd.ma@gmail.com Received: by mail-pj1-f67.google.com with SMTP id w9so3809812pjh.1; Fri, 27 Mar 2020 05:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fsqy8TfQMOxnl1SbG7WxWf+f3gEqGelUnglQJSOP4Ds=; b=Q2Otw0ipFM9So8sggRAQgCgojzHVsLtIWn5ukWMxPAJdhOBRRO8zrGPlbCo0y2GA6f sfSVJRy6ndUByUc0Y3zWpTCLkaYG1RKjr/IHeNTv1R/Pb2gMLXbg9ioX4QgQHzRY5cps N3G1ayLdmVxwy4ZjqYlozMN1h34Utvi7fqBiojTRK0pIWMPWvGE0LkUWFA7kqgJuJxja rKlEgcXH3J6jBX59IpTWHjzmjQIIBmiyOt5i1v4tca9ZWxogZVM6CDRSdBnOmpGpFEth pjmUsrvDUdhO3Bv5CYeCGEspT8IqMcwpli64OnZGn6JM6hBdUYfCQ86yCN7labB76D8d c4Aw== 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; bh=Fsqy8TfQMOxnl1SbG7WxWf+f3gEqGelUnglQJSOP4Ds=; b=T3qlNFraYn7TVa1Y2GobTZvs3ssxVSkwmCmLPjI7ZxTVDf9AtWveeEZPKt1x9dTty5 BXvpTBNwv5LTlkePI5ydvVjATl/XQHKhhKRYy4d1//xLxZJhlSKVx2GsoRN35hvkUlFt lpKV3AfLxExVW7PnQziKRu2drhD8EMmIl9b2RmbSIy6E5X07G9bGCLsdrAuNbOo+626e ab+pWL8h1DbPqlCw8skMs9jzMZ4HyBO7Sjt6BUjpsYzlOQNyH3Tmdvut/lpPmTBNtU/b Qko1LR3Swube3OFZp6Hc8jePobMJa+qXYXN96YA5WFckMpNluvpOjEdC930rxOQ5eZ4I Ld3A== X-Gm-Message-State: ANhLgQ1wHRBFQY6QjXnP6kxTbnCAHfT4j9n8NbT0pMkLzHi4U1rpqCWH Ni8Cc6CpBuW/KZR6hKks1Ik= X-Google-Smtp-Source: ADFU+vsoujK+muRM6+KaBCVLLvd9JnFa4Q3MxDpF532ov0b1AY3yVciRuMclmYx+K3BcdM08YjVIlA== X-Received: by 2002:a17:90a:1b22:: with SMTP id q31mr5878074pjq.109.1585313055028; Fri, 27 Mar 2020 05:44:15 -0700 (PDT) Received: from localhost.localdomain ([49.207.51.33]) by smtp.gmail.com with ESMTPSA id v26sm4056641pfn.51.2020.03.27.05.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 05:44:14 -0700 (PDT) From: afzal mohammed List-Id: To: Arnd Bergmann , SoC Team Cc: afzal mohammed , Thomas Gleixner , Tony Lindgren , Alexander Sverdlin , =?utf-8?q?Krzysztof_Ha?= =?utf-8?q?=C5=82asa?= , Viresh Kumar , Lubomir Rintel , Gregory CLEMENT , Hartley Sweeten , Viresh Kumar , Shiraz Hashim , Andrew Lunn , Jason Cooper , Sebastian Hesselbarth , Russell King , Linux ARM , "linux-kernel@vger.kernel.org" , arm-soc , Olof Johansson Subject: [PATCH v4 2/5] ARM: spear: replace setup_irq() by request_irq() Date: Fri, 27 Mar 2020 18:14:06 +0530 Message-Id: <20200327124406.4123-1-afzal.mohd.ma@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready. 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(). [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed Acked-by: Viresh Kumar --- v4: * Add received tags v3: * Split out from series, also split out from ARM patch to subarch level as Thomas suggested to take it thr' respective maintainers * Modify string displayed in case of error as suggested by Thomas * Re-arrange code as required to improve readability * Remove irrelevant parts from commit message & improve v2: * Replace pr_err("request_irq() on %s failed" by pr_err("%s: request_irq() failed" * Commit message massage arch/arm/mach-spear/time.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c index 289e036c9c30..d1fdb6066f7b 100644 --- a/arch/arm/mach-spear/time.c +++ b/arch/arm/mach-spear/time.c @@ -181,12 +181,6 @@ static irqreturn_t spear_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction spear_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER, - .handler = spear_timer_interrupt -}; - static void __init spear_clockevent_init(int irq) { u32 tick_rate; @@ -201,7 +195,8 @@ static void __init spear_clockevent_init(int irq) clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0); - setup_irq(irq, &spear_timer_irq); + if (request_irq(irq, spear_timer_interrupt, IRQF_TIMER, "timer", NULL)) + pr_err("Failed to request irq %d (timer)\n", irq); } static const struct of_device_id timer_of_match[] __initconst = {