Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp768897ybj; Tue, 5 May 2020 07:17:44 -0700 (PDT) X-Google-Smtp-Source: APiQypINBrJWcoJSo6CY9ztpnnsGQolr5PivJlWbZZi4rxopHRKyiWf83vXFrcYA9Gs2Ydl56m2G X-Received: by 2002:a17:906:6990:: with SMTP id i16mr2755452ejr.175.1588688264279; Tue, 05 May 2020 07:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588688264; cv=none; d=google.com; s=arc-20160816; b=IOxZm2uFqoqISMDGA09JqIVBnU88TvdIzRyZQWlDWzZoJVbIkbc065I/3vlaq/T9cL m/jDk9E6UHIT0f1xXVx4PgD4NcZ3wCQMwOqhpHInOS0baNV1OlZKJc7zU0CwHPVIYmX4 pKIzoXCSXtihXhEeCeEfMQGMx27C2uyZvMIK9MdgnYU7V278axmrHm+VmiBZ1zxURREW 0LJPMNsUpNNoVrgMMG0foM9PuuzcYcOf8M4+QJyEqqeLFBHWOxVNA0LYXELY2fNMqiC6 yWlgJ3jtUhRO5nADZqECtF9uQOgIdeP0FTe9oeVxscja680E/ldHH4hS7kx/bff9IYnc FL7Q== 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 :message-id:date:subject:cc:to:from; bh=tZuABAqUFgqXvHBkISxaV+P0NI7G5n67R5cp2jhE7tM=; b=1BVHXmqZvxlyjIEEKUIbfasZQgCXh0W7OtC9tI9KXg1WHi5ZZlCFDqQyonc50pRP0q UeEIGFmDd7O8zM1fPE7HqfZ3ROm767lLi547KvAQEb6HO7b52jDWTPxcXU9l7jq2Y1yF NLscLsu0OrVaMWAAlWHjY9BlA03hNaHcfCfTWqSMr43I1h0/KHxMQZSMQyH8LWpUiVNm +3NC8QAmw8ijSMfc7VlT7UVPig1SybfVrS7+EqsB3/StQ5vx3TW68mBYEB63lqGv5CN7 Zs0gCX9Qd29FjeZCCm5OPCH9xRiQOMjHdPpyKo6p+rNGCcRJ+tAL/ug1xf7T9swX/VQH prLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si1211760ejr.99.2020.05.05.07.16.58; Tue, 05 May 2020 07:17:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729584AbgEEOOc (ORCPT + 99 others); Tue, 5 May 2020 10:14:32 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:36381 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729559AbgEEOOW (ORCPT ); Tue, 5 May 2020 10:14:22 -0400 Received: from localhost.localdomain ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MBDrM-1jQzi83buY-00CePX; Tue, 05 May 2020 16:14:02 +0200 From: Arnd Bergmann To: Kevin Hilman , Aaro Koskinen , Tony Lindgren Cc: Arnd Bergmann , afzal mohammed , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: omap1: fix irq setup Date: Tue, 5 May 2020 16:13:48 +0200 Message-Id: <20200505141400.767312-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:LvLPepcWVA3cOq/dneR4EUFbqygTCx28UhrDXt4MYSPcNJ4mrg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JXK6XyLcf6VORR8tpPigNQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A recent cleanup introduced a bug on any omap1 machine that has no wakeup IRQ, i.e. omap15xx: arch/arm/mach-omap1/pm.c:656:11: error: variable 'irq' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] else if (cpu_is_omap16xx()) ^~~~~~~~~~~~~~~~~ include/linux/soc/ti/omap1-soc.h:115:30: note: expanded from macro 'cpu_is_omap16xx' # define cpu_is_omap16xx() is_omap16xx() ^~~~~~~~~~~~~ arch/arm/mach-omap1/pm.c:658:18: note: uninitialized use occurs here if (request_irq(irq, omap_wakeup_interrupt, 0, "peripheral wakeup", ^~~ arch/arm/mach-omap1/pm.c:656:7: note: remove the 'if' if its condition is always true else if (cpu_is_omap16xx()) ^~~~~~~~~~~~~~~~~~~~~~ arch/arm/mach-omap1/pm.c:611:9: note: initialize the variable 'irq' to silence this warning int irq; ^ Move this code into a separate function to deal with it cleanly. Fixes: b75ca5217743 ("ARM: OMAP: replace setup_irq() by request_irq()") Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/pm.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 0f8064bd40ae..266aa08aa8ed 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -605,10 +605,25 @@ static const struct platform_suspend_ops omap_pm_ops = { .valid = suspend_valid_only_mem, }; +static void omap_wakeup_init(void) +{ + int irq; + + if (cpu_is_omap7xx()) + irq = INT_7XX_WAKE_UP_REQ; + else if (cpu_is_omap16xx()) + irq = INT_1610_WAKE_UP_REQ; + else + return; + + if (request_irq(irq, omap_wakeup_interrupt, 0, "peripheral wakeup", + NULL)) + pr_err("Failed to request irq %d (peripheral wakeup)\n", irq); +} + static int __init omap_pm_init(void) { int error = 0; - int irq; if (!cpu_class_is_omap1()) return -ENODEV; @@ -651,13 +666,7 @@ static int __init omap_pm_init(void) arm_pm_idle = omap1_pm_idle; - if (cpu_is_omap7xx()) - irq = INT_7XX_WAKE_UP_REQ; - else if (cpu_is_omap16xx()) - irq = INT_1610_WAKE_UP_REQ; - if (request_irq(irq, omap_wakeup_interrupt, 0, "peripheral wakeup", - NULL)) - pr_err("Failed to request irq %d (peripheral wakeup)\n", irq); + omap_wakeup_init(); /* Program new power ramp-up time * (0 for most boards since we don't lower voltage when in deep sleep) -- 2.26.0