Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp316060yba; Sat, 20 Apr 2019 03:14:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCJ1ogAkv2HB9UjV3iXNMQZ1nLe8oBairEq8ORnZrY5PMOYAP/y4+hivxGb9LfdJ0G6b+b X-Received: by 2002:a17:902:be18:: with SMTP id r24mr8567569pls.69.1555755263508; Sat, 20 Apr 2019 03:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555755263; cv=none; d=google.com; s=arc-20160816; b=v9PD4TTU1dOK69oUdl61druIKoAltSi+5AnydjFnf43oiCgUGbanHtURJ/eJTlCUKm 3wAxOvMGWxsO21dQGo3EoZZB8Ui8PMLEfksZaA/BkuXi1cGkc1lleaXWjQFMoDKSx7JA W/7jAjeRLydFJ5JOz7gk45W4Xs4INLj1GRIdl/uoFUICX/WwZ62A45keATmc8CdMfrH7 Tq88j6VwD+OtBunTcD1jInQukYYxQX5qBggT5ZUfXIouBZC07R8pBBgSyV0/rNOoGLaN q9CjpW3wlq5l2oApxrh2qErXhjPDJCVRLjk9hXW0oOvWmx60nV2uM+aVyS58mXCOGKEW Z30Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iXUXUm4QoDhPmhf12xtdYiS+6qxDPoq2OQmGpFJkuFU=; b=OLErvcsGWvXlQ3/t7ZHVC7swgNaHOfl8S294xRq9XiQtRsMhljgruxdtVGqE/KWoRt 3yev1lppHuGqxWFAiMfjmVV5CBTqWew3ICR20WWMXky/mQkQFsev0fpWnbKmEux5Ykux ljNooldvGQ5fpor9iKKwPheGz1zyr94/TAbb3PQWZBJhIYmuoRgTDRztlULiT4PnAEgT Th/84IgqoJ1bQQpSiJmnyFXgL0RK68wo/s2H1nz7dC/nV/Xt52rmzH2MYQW/TBzpdcmd yjhhiTsUjF8zTdFxMi/9BHeHgvOkq61wMEorSWKWJTGeHWUaZGXZrtIvZ8zur6KS5t+S +NXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NpvI9a0L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f127si7900631pfc.176.2019.04.20.03.13.33; Sat, 20 Apr 2019 03:14:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NpvI9a0L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728138AbfDTKLV (ORCPT + 99 others); Sat, 20 Apr 2019 06:11:21 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:54568 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728104AbfDTKLU (ORCPT ); Sat, 20 Apr 2019 06:11:20 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3KAAsha023762; Sat, 20 Apr 2019 05:10:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555755054; bh=iXUXUm4QoDhPmhf12xtdYiS+6qxDPoq2OQmGpFJkuFU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NpvI9a0Loe5B1S9BUyiPnsoOgQK8KzeXb2pik8ijlxoncTqMhyaNrZm/a1kHLCzqx 6bXCgzC/54I7J7vEPJgC/76zVVRPfwEkfPtEraa74Dg4OBOnq+Yrrr7oPHQVx5S2sU MajlbCZVsfdRibGMzVxC1KVnehijDrFab84ntX/M= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3KAAsNn060173 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 20 Apr 2019 05:10:54 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Sat, 20 Apr 2019 05:10:54 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Sat, 20 Apr 2019 05:10:54 -0500 Received: from uda0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3KAAHZw070234; Sat, 20 Apr 2019 05:10:50 -0500 From: Lokesh Vutla To: Marc Zyngier , Santosh Shilimkar , Rob Herring , Nishanth Menon , , CC: Linux ARM Mailing List , , Tero Kristo , Sekhar Nori , Tony Lindgren , , Peter Ujfalusi , Grygorii Strashko , Lokesh Vutla , Device Tree Mailing List , Subject: [PATCH v7 07/14] gpio: thunderx: Use the default parent apis for {request,release}_resources Date: Sat, 20 Apr 2019 15:39:43 +0530 Message-ID: <20190420100950.7997-8-lokeshvutla@ti.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190420100950.7997-1-lokeshvutla@ti.com> References: <20190420100950.7997-1-lokeshvutla@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org thunderx_gpio_irq_{request,release}_resources apis are trying to {request,release} resources on parent interrupt. There are default apis doing the same. Use the default parent apis instead of writing the same code snippet. Cc: linux-gpio@vger.kernel.org Cc: Linus Walleij Signed-off-by: Lokesh Vutla --- Changes since v6: - new patch drivers/gpio/gpio-thunderx.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c index 1306722faa5a..715371b5102a 100644 --- a/drivers/gpio/gpio-thunderx.c +++ b/drivers/gpio/gpio-thunderx.c @@ -363,22 +363,16 @@ static int thunderx_gpio_irq_request_resources(struct irq_data *data) { struct thunderx_line *txline = irq_data_get_irq_chip_data(data); struct thunderx_gpio *txgpio = txline->txgpio; - struct irq_data *parent_data = data->parent_data; int r; r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); if (r) return r; - if (parent_data && parent_data->chip->irq_request_resources) { - r = parent_data->chip->irq_request_resources(parent_data); - if (r) - goto error; - } + r = irq_chip_request_resources_parent(data); + if (r) + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); - return 0; -error: - gpiochip_unlock_as_irq(&txgpio->chip, txline->line); return r; } @@ -386,10 +380,8 @@ static void thunderx_gpio_irq_release_resources(struct irq_data *data) { struct thunderx_line *txline = irq_data_get_irq_chip_data(data); struct thunderx_gpio *txgpio = txline->txgpio; - struct irq_data *parent_data = data->parent_data; - if (parent_data && parent_data->chip->irq_release_resources) - parent_data->chip->irq_release_resources(parent_data); + irq_chip_release_resources_parent(data); gpiochip_unlock_as_irq(&txgpio->chip, txline->line); } -- 2.21.0