From patchwork Sat Aug 1 07:06:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 6921951 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 618439F39B for ; Sat, 1 Aug 2015 07:07:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 935C120453 for ; Sat, 1 Aug 2015 07:07:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A421F20524 for ; Sat, 1 Aug 2015 07:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751228AbbHAHHS (ORCPT ); Sat, 1 Aug 2015 03:07:18 -0400 Received: from www.linutronix.de ([62.245.132.108]:55948 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbbHAHHQ (ORCPT ); Sat, 1 Aug 2015 03:07:16 -0400 Received: from localhost ([127.0.0.1] helo=[127.0.1.1]) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1ZLQsz-0007jp-EF; Sat, 01 Aug 2015 09:07:13 +0200 Message-Id: <20150801062953.019485129@linutronix.de> User-Agent: quilt/0.63-1 Date: Sat, 01 Aug 2015 07:06:58 -0000 From: Thomas Gleixner To: LKML Cc: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org Subject: [patch 2/2] dma: ipu: Consolidate duplicated irq handlers References: <20150801062810.250199839@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline; filename=dma--ipu--Consolidate-duplicated-irq-handlers X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001, URIBL_BLOCKED=0.001 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 functions irq_irq_err and ipu_irq_fn are identical plus/minus the comments. Remove one. Signed-off-by: Thomas Gleixner Cc: Vinod Koul Cc: Dan Williams Cc: dmaengine@vger.kernel.org --- drivers/dma/ipu/ipu_irq.c | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-next/drivers/dma/ipu/ipu_irq.c =================================================================== --- linux-next.orig/drivers/dma/ipu/ipu_irq.c +++ linux-next/drivers/dma/ipu/ipu_irq.c @@ -265,8 +265,8 @@ int ipu_irq_unmap(unsigned int source) return ret; } -/* Chained IRQ handler for IPU error interrupt */ -static void ipu_irq_err(unsigned int __irq, struct irq_desc *desc) +/* Chained IRQ handler for IPU function and error interrupt */ +static void ipu_irq_handler(unsigned int __irq, struct irq_desc *desc) { struct ipu *ipu = irq_desc_get_handler_data(desc); u32 status; @@ -307,44 +307,6 @@ static void ipu_irq_err(unsigned int __i } } -/* Chained IRQ handler for IPU function interrupt */ -static void ipu_irq_fn(unsigned int __irq, struct irq_desc *desc) -{ - struct ipu *ipu = irq_desc_get_handler_data(desc); - u32 status; - int i, line; - - for (i = 0; i < IPU_IRQ_NR_FN_BANKS; i++) { - struct ipu_irq_bank *bank = irq_bank + i; - - raw_spin_lock(&bank_lock); - status = ipu_read_reg(ipu, bank->status); - /* Not clearing all interrupts, see above */ - status &= ipu_read_reg(ipu, bank->control); - raw_spin_unlock(&bank_lock); - while ((line = ffs(status))) { - struct ipu_irq_map *map; - unsigned int irq; - - line--; - status &= ~(1UL << line); - - raw_spin_lock(&bank_lock); - map = src2map(32 * i + line); - if (map) - irq = map->irq; - raw_spin_unlock(&bank_lock); - - if (!map) { - pr_err("IPU: Interrupt on unmapped source %u bank %d\n", - line, i); - continue; - } - generic_handle_irq(irq); - } - } -} - static struct irq_chip ipu_irq_chip = { .name = "ipu_irq", .irq_ack = ipu_irq_ack, @@ -384,9 +346,9 @@ int __init ipu_irq_attach_irq(struct ipu #endif } - irq_set_chained_handler_and_data(ipu->irq_fn, ipu_irq_fn, ipu); + irq_set_chained_handler_and_data(ipu->irq_fn, ipu_irq_handler, ipu); - irq_set_chained_handler_and_data(ipu->irq_err, ipu_irq_err, ipu); + irq_set_chained_handler_and_data(ipu->irq_err, ipu_irq_handler, ipu); ipu->irq_base = irq_base;