From patchwork Fri May 23 10:31:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30750 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA62A2066E for ; Fri, 23 May 2014 10:44:45 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf22539719iec.4 for ; Fri, 23 May 2014 03:44:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=n4agDoXUZpzPqzvukGiRMdFup/bCkHgw+aZ3E7Vn9Qs=; b=ThBAbQuzdsaWx+82joGGefFcyLfAaRIEnEdfKBhHhcK18Au4jAWGc0KCUGv4DSpdpL 2vhbJtFfLRCFZR2y8cKxF+GanzVqELGQAgfboVGVwtgEp9s/RKKDVlJYqlzfcWyR84eW cC2UodVdoVVrqNB1xYrd4XnDm2q/K/UbfhzzJyZXoxdT6TuPXgKhDnJcmIgiAg4k2P2C aMmDM7Bff4xPGn2V/3wuafVZUqr9X+G6Yk65t6EIT7CXKK6CSNCR21xNXWEcP1rjQaSg wueGY7I7ZrlastxDEytBp8iGWE+Fk4TyxEtiI5938shcT2ztjfYhPKDIpEs2mvCoI0HF gOdA== X-Gm-Message-State: ALoCoQlsa2H35dvc0sQRu3LfwEOkKVARN4F2FGDBRHZkN5rLmjxN2G0EC9lXzGNUi/AlUyZYmwJF X-Received: by 10.182.104.161 with SMTP id gf1mr1766150obb.45.1400841885134; Fri, 23 May 2014 03:44:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.247 with SMTP id b110ls1598426qge.16.gmail; Fri, 23 May 2014 03:44:45 -0700 (PDT) X-Received: by 10.221.66.131 with SMTP id xq3mr140593vcb.43.1400841885015; Fri, 23 May 2014 03:44:45 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id m3si1394015vcr.51.2014.05.23.03.44.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so5930701vcb.4 for ; Fri, 23 May 2014 03:44:44 -0700 (PDT) X-Received: by 10.58.201.5 with SMTP id jw5mr3370675vec.6.1400841884894; Fri, 23 May 2014 03:44:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp20532vcb; Fri, 23 May 2014 03:44:44 -0700 (PDT) X-Received: by 10.68.193.100 with SMTP id hn4mr4800537pbc.50.1400841884055; Fri, 23 May 2014 03:44:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bv3si3363377pad.79.2014.05.23.03.44.43 for ; Fri, 23 May 2014 03:44:43 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654AbaEWKoh (ORCPT + 27 others); Fri, 23 May 2014 06:44:37 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:37349 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbaEWKcV (ORCPT ); Fri, 23 May 2014 06:32:21 -0400 Received: by mail-wi0-f180.google.com with SMTP id hi2so625749wib.1 for ; Fri, 23 May 2014 03:32:20 -0700 (PDT) X-Received: by 10.194.6.166 with SMTP id c6mr2116434wja.64.1400841140225; Fri, 23 May 2014 03:32:20 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-404-187.w82-125.abo.wanadoo.fr. [82.125.3.187]) by mx.google.com with ESMTPSA id s9sm2200908wix.13.2014.05.23.03.32.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:19 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 36/71] clocksource: sh_mtu2: Use request_irq() instead of setup_irq() Date: Fri, 23 May 2014 12:31:16 +0200 Message-Id: <1400841111-6683-36-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> References: <537F214C.8000700@linaro.org> <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Laurent Pinchart The driver claims it needs to register an interrupt handler too early for request_irq(). This might have been true in the past, but the only meaningful difference between request_irq() and setup_irq() today is an additional kzalloc() call in request_irq(). As the driver calls kmalloc() itself we know that the slab allocator is available, we can thus switch to request_irq(). Signed-off-by: Laurent Pinchart Tested-by: Wolfram Sang --- drivers/clocksource/sh_mtu2.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index e30d76e..77992e0 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -37,7 +37,7 @@ struct sh_mtu2_priv { void __iomem *mapbase; struct clk *clk; - struct irqaction irqaction; + int irq; struct platform_device *pdev; unsigned long rate; unsigned long periodic; @@ -244,10 +244,11 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_priv *p, dev_info(&p->pdev->dev, "used for clock events\n"); clockevents_register_device(ced); - ret = setup_irq(p->irqaction.irq, &p->irqaction); + ret = request_irq(p->irq, sh_mtu2_interrupt, + IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, + dev_name(&p->pdev->dev), p); if (ret) { - dev_err(&p->pdev->dev, "failed to request irq %d\n", - p->irqaction.irq); + dev_err(&p->pdev->dev, "failed to request irq %d\n", p->irq); return; } } @@ -265,7 +266,7 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) { struct sh_timer_config *cfg = pdev->dev.platform_data; struct resource *res; - int irq, ret; + int ret; ret = -ENXIO; memset(p, 0, sizeof(*p)); @@ -284,8 +285,8 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) goto err0; } - irq = platform_get_irq(p->pdev, 0); - if (irq < 0) { + p->irq = platform_get_irq(p->pdev, 0); + if (p->irq < 0) { dev_err(&p->pdev->dev, "failed to get irq\n"); goto err0; } @@ -297,13 +298,6 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) goto err0; } - /* setup data for setup_irq() (too early for request_irq()) */ - p->irqaction.name = dev_name(&p->pdev->dev); - p->irqaction.handler = sh_mtu2_interrupt; - p->irqaction.dev_id = p; - p->irqaction.irq = irq; - p->irqaction.flags = IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING; - /* get hold of clock */ p->clk = clk_get(&p->pdev->dev, "mtu2_fck"); if (IS_ERR(p->clk)) {