Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp682814ybh; Wed, 11 Mar 2020 08:44:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuBcn9GlBdQ9ASeKVOtGsP0NPL4adRMEWErHrfLCWevhOcg+z+NDof+uPKm95jCuD3U9WqK X-Received: by 2002:a9d:70c5:: with SMTP id w5mr2945785otj.58.1583941499076; Wed, 11 Mar 2020 08:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583941499; cv=none; d=google.com; s=arc-20160816; b=F+9VPO5ulreGbvQkkYtjKqbo6u7HolepcAqa358m1ERQVInbfi8eTi97xGft+hn69r QOr+csvAhs4MbracppD+KgYwKdCdTZDeogRnhpQunRBorS5HOTnjoL1gZOS4ADA7DrAX LUXhvTC7scEuSHkPna/YXYuLoRGBp841W5hC+tJ+n5fUM1oSLmGEyyNAEJrkOatre0m2 GXuyYaCpmIUEfpxWftvhivGvOtIvkf412nNWM1zwrtb9hryda4NXqhkNO5G0hYBjNdBh jpMzgxxKtS3FxrfKPjVeuaxN5II1NFCt4rAocttQPpvjjV5XTFWWpLrzfz6bCLF2lYXv cr7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=AoaXOK96+TZutj4Qkso/mKbAZoM0HefwiQye29hh4WI=; b=mlDvWWwP2vf6/+HKq/eockqJ2tJQAlgMgwzF1kjTQAq3/HvMwn4QVckBm7NBw2hNbf dPPC2auJTQusKczlPXdYBbeNdkgYTmkwbRdEHSPMvAPeIqd08Re29hUAYwQ+pQM714Vp YKJETEtPwO8SoRMhOWnrg9X2ilGo6iohF5AR/WR6pZkmFSpqe/V/dzjxI7Q0hkqk4q4C evFur4tlAi9InVvBzyy7KybILChL+Zzb62YmUOEUnZRJdDc2z3puaOGNTgVlBTrQtTs5 yeWr86CheSX15LaVOgMtWZU/2/+lXo8WSnHT4ro6hhMBpKOrc8GSm1MsKSczjLUC468z h4tA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w33si1245174otb.48.2020.03.11.08.44.47; Wed, 11 Mar 2020 08:44:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730042AbgCKPn6 (ORCPT + 99 others); Wed, 11 Mar 2020 11:43:58 -0400 Received: from lists.gateworks.com ([108.161.130.12]:39778 "EHLO lists.gateworks.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729848AbgCKPn6 (ORCPT ); Wed, 11 Mar 2020 11:43:58 -0400 Received: from 68-189-91-139.static.snlo.ca.charter.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by lists.gateworks.com with esmtp (Exim 4.82) (envelope-from ) id 1jC3Xn-0008Ub-Ga; Wed, 11 Mar 2020 15:45:15 +0000 From: Tim Harvey To: Linus Walleij , Robert Richter , Lokesh Vutla Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Tim Harvey Subject: [PATCH] gpio: thunderx: fix irq_request_resources Date: Wed, 11 Mar 2020 08:43:53 -0700 Message-Id: <1583941433-15876-1-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there are no parent resources do not call irq_chip_request_resources_parent at all as this will return an error. This resolves a regression where devices using a thunderx gpio as an interrupt would fail probing. Fixes: 0d04d0c ("gpio: thunderx: Use the default parent apis for {request,release}_resources") Signed-off-by: Tim Harvey --- drivers/gpio/gpio-thunderx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c index 4627704..f84b9b1 100644 --- a/drivers/gpio/gpio-thunderx.c +++ b/drivers/gpio/gpio-thunderx.c @@ -366,15 +366,18 @@ 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; - r = irq_chip_request_resources_parent(data); - if (r) - gpiochip_unlock_as_irq(&txgpio->chip, txline->line); + if (parent_data && parent_data->chip->irq_request_resources) { + r = irq_chip_request_resources_parent(data); + if (r) + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); + } return r; } -- 2.7.4