From patchwork Fri May 23 10:31:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30691 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB0BA2066E for ; Fri, 23 May 2014 10:32:40 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oz11sf17139073veb.2 for ; Fri, 23 May 2014 03:32:40 -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=NzIurfZ2UEhOGlBwdGJLilR1XTMtKD4HzK07GwhzEfs=; b=fsU/42L4L5pz3Arm/XcrvIlzP/HtItJzboycz5Jehj550KUCnDFpxDPgBFfVp/N7Ov JtlPZQA55CxxAm/AJPqK4ziSIrQWShJr3UJ/yUGAgDJxTVjd4AZcCe09m+wRE1Rw3ntT 2oSAfLbjFugPw5SkhtLgB88XggpfyWArs2Db4BitB+VgBcBQwLv+bLzxZe1TFqwMOkuq a8o2hwus2N+lA5narBLtPbIf2rvi99OhoCjAYbV9D/N3NWhCVMShl+wK8fufpTBZco0u 4+Iwi6oOjGLKv5ZJDwjo42hx35qgBO6+oNt3igoIO4XxIn+8dlDCRsu7pLnddNG1eyUW +uGQ== X-Gm-Message-State: ALoCoQlEAbKOWttVd2y7kSDskAmc9QvvZLvtFSL2YHAewggQ8YeCTZCd7riGB4GHgL5qmYTQI2ir X-Received: by 10.52.36.211 with SMTP id s19mr1563068vdj.7.1400841160404; Fri, 23 May 2014 03:32:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.201 with SMTP id k67ls1696668qge.22.gmail; Fri, 23 May 2014 03:32:40 -0700 (PDT) X-Received: by 10.220.106.7 with SMTP id v7mr97697vco.46.1400841160312; Fri, 23 May 2014 03:32:40 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id dh1si1391248veb.23.2014.05.23.03.32.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id oz11so6030602veb.30 for ; Fri, 23 May 2014 03:32:40 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr3345138vcw.15.1400841160225; Fri, 23 May 2014 03:32:40 -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 ib8csp19795vcb; Fri, 23 May 2014 03:32:39 -0700 (PDT) X-Received: by 10.66.197.201 with SMTP id iw9mr4391726pac.151.1400841159480; Fri, 23 May 2014 03:32:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg4si3275525pbb.67.2014.05.23.03.32.38 for ; Fri, 23 May 2014 03:32:38 -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 S1752733AbaEWKcK (ORCPT + 27 others); Fri, 23 May 2014 06:32:10 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:52080 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752658AbaEWKcD (ORCPT ); Fri, 23 May 2014 06:32:03 -0400 Received: by mail-wi0-f180.google.com with SMTP id hi2so619172wib.13 for ; Fri, 23 May 2014 03:32:02 -0700 (PDT) X-Received: by 10.180.211.207 with SMTP id ne15mr2359253wic.31.1400841122029; Fri, 23 May 2014 03:32:02 -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.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:01 -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 21/71] clocksource: sh_tmu: Use request_irq() instead of setup_irq() Date: Fri, 23 May 2014 12:31:01 +0200 Message-Id: <1400841111-6683-21-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.128.171 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 --- drivers/clocksource/sh_tmu.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index ecd7b60..8613cc9 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -38,7 +38,7 @@ struct sh_tmu_priv { void __iomem *mapbase; struct clk *clk; - struct irqaction irqaction; + int irq; struct platform_device *pdev; unsigned long rate; unsigned long periodic; @@ -401,10 +401,11 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p, clockevents_config_and_register(ced, 1, 0x300, 0xffffffff); - ret = setup_irq(p->irqaction.irq, &p->irqaction); + ret = request_irq(p->irq, sh_tmu_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; } } @@ -425,7 +426,7 @@ static int sh_tmu_setup(struct sh_tmu_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)); @@ -444,8 +445,8 @@ static int sh_tmu_setup(struct sh_tmu_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; } @@ -457,13 +458,6 @@ static int sh_tmu_setup(struct sh_tmu_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_tmu_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, "tmu_fck"); if (IS_ERR(p->clk)) {