From patchwork Mon Feb 3 16:46:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 3569931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2F636C02DC for ; Mon, 3 Feb 2014 16:51:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DF862012F for ; Mon, 3 Feb 2014 16:51:16 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F27B201C0 for ; Mon, 3 Feb 2014 16:51:15 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAMjM-0003n9-13; Mon, 03 Feb 2014 16:50:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAMj8-0001Bu-H3; Mon, 03 Feb 2014 16:50:30 +0000 Received: from mail-we0-f169.google.com ([74.125.82.169]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAMj5-00019o-8i for linux-arm-kernel@lists.infradead.org; Mon, 03 Feb 2014 16:50:28 +0000 Received: by mail-we0-f169.google.com with SMTP id t61so2566983wes.28 for ; Mon, 03 Feb 2014 08:49:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=TdYWzgbZmpan0NMGJOqKAC4ZXyNqKimj06IcAR9aIws=; b=WQQdegvmSsMIUTyIeWJcTPLVyI+tbghLrqItl9LyiLYntqhPaiV8CPIoTqjMS2jC5d MHUuaF2LOV1+xI8OneD+1kprz6Z5nqjNe0L/1pqlh/P9NsKDglDhr4Rdk5ZAUHssDIZ7 YgsNYQiGjQvEQpX5Tmm+YCO0nVhKZa/89M1eze24iPT6uLSzc0n1eKrbQr3Y8W1mKvOz L7F/zVWzObRdzBX15yfATE1ykApCz5qQ3EXgHay1+SxpVNGbSPgcGCMIAGI6COpPq6l0 Y46/16W96QDuOalxVIPVp9BIdWm1hY5Ouxe6HSYGE9bKHsQCFIb4p4Z0PHYhTR6rsZA+ vU5g== X-Received: by 10.194.187.101 with SMTP id fr5mr215700wjc.76.1391446198214; Mon, 03 Feb 2014 08:49:58 -0800 (PST) Received: from stedf17-labo202.ds.jdsu.net. (4-161.80-90.static-ip.oleane.fr. [90.80.161.4]) by mx.google.com with ESMTPSA id bm8sm45293254wjc.12.2014.02.03.08.49.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Feb 2014 08:49:57 -0800 (PST) From: Jean-Jacques Hiblot To: b.brezillon@overkiz.com, nicolas.ferre@atmel.com Subject: [PATCH] at91: pmc: Fixed irq's name allocation for programmable clocks Date: Mon, 3 Feb 2014 17:46:01 +0100 Message-Id: <1391445961-20755-1-git-send-email-jjhiblot@traphandler.com> X-Mailer: git-send-email 1.8.5.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140203_115027_407246_2D821B1D X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Jean-Jacques Hiblot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The name provided to request_irq() must be valid until the irq is released. This patch allocates and formats the string with kasprintf(). Signed-off-by: Jean-Jacques Hiblot --- drivers/clk/at91/clk-programmable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index 8e242c7..0f8bf0f 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "pmc.h" @@ -247,7 +248,7 @@ at91_clk_register_programmable(struct at91_pmc *pmc, unsigned int irq, struct clk_programmable *prog; struct clk *clk = NULL; struct clk_init_data init; - char irq_name[11]; + char *irq_name; if (id > PROG_ID_MAX) return ERR_PTR(-EINVAL); @@ -269,7 +270,7 @@ at91_clk_register_programmable(struct at91_pmc *pmc, unsigned int irq, prog->irq = irq; init_waitqueue_head(&prog->wait); irq_set_status_flags(prog->irq, IRQ_NOAUTOEN); - snprintf(irq_name, sizeof(irq_name), "clk-prog%d", id); + irq_name = kasprintf(GFP_KERNEL, "clk-prog%d", id); ret = request_irq(prog->irq, clk_programmable_irq_handler, IRQF_TRIGGER_HIGH, irq_name, prog); if (ret)