Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp505124ybk; Wed, 13 May 2020 05:58:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVPJ7Eh+LU1ylRHCkvJ8BlS7MxVsuctp4L7jghtBytXFdj6WMmcwJg7xOVLqCzn/cy0ulm X-Received: by 2002:a17:906:51b:: with SMTP id j27mr12810474eja.246.1589374682726; Wed, 13 May 2020 05:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589374682; cv=none; d=google.com; s=arc-20160816; b=k/YZivFwQblUzwRpjQv6GdfaMu+p6h/gVuxD4eztfQrjAIqWtnG3On0Nv3VeDSgHVu WB5pcnEbA8gvWSpmwkAPd7q6rIBVZmG4qJm46jnUOW1Y41N0D1wjEy1W2QMGmVkPM0Ux kPHBzJO7ZvoL4jG7oJvX5kbSniHzKwzKJ23az4H17W1ECl0x6d7IllIjWPPaiBOO9dEF bypsvEdctcmtEJMEQ54cIpnpMxkVBxlZL+fSEKcoS78okqetweyLTOELTSs7T8rzr+aJ tQA2urP86gjzmCVevVFma50PB7SEzQhkTbxHC7BD5KfOo8davkkMNGyigjj8IA/FXVWF 7LIQ== 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 :ironport-sdr:dkim-signature; bh=PuUf5EZgFvJCV24wsPztOoqcPh9/tM3QN2O1Oq01wko=; b=y3CzuRZfWMUaQNvnsx3i6iUax6jfCwU415sQXvZY01AfqjZjHLeC5OnsDYienMbsLd bYlhFiAmHa0qsFqHepoN4SyPXEB5ojtSASZyeeSPdQoVwkTYlCUcWFqsgaTiluXzxc8x MmkoJ4FE6nyvBveQ1e3T5bBHMzK3q2tAVOqsLqyVrQrCaZbGk9csxyfcUrMnENgtueXK 6U/rrRv5RLWn55fKHMS2DJ2ZmmBOPJr/rQmx4FvEzeYg1nSNacs+8j3f9bdOwq2fPKZZ ZTC+P9j9HOPQrxcU9KXtdmOg8P/G4JnsA0qtzx3tI3kleY7sn5jRe+Iy800eUlRBqvfg b9ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=fXj5Izqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do16si12705039ejc.265.2020.05.13.05.57.38; Wed, 13 May 2020 05:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=fXj5Izqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732006AbgEMM4I (ORCPT + 99 others); Wed, 13 May 2020 08:56:08 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:41461 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728413AbgEMM4H (ORCPT ); Wed, 13 May 2020 08:56:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1589374567; x=1620910567; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tWUrw/osLjvb/c0rlAloWSn6upuy4DQgjffgP9JdqBU=; b=fXj5IzqatnlmyMgZfRkj1ugYDueFfws12kYd6ZfyLtohOPHskYcdypub naxOw3T6+MR+ZChif35dzcNcjWvDZdGSdkBu7kIXBbyhpfU3nG3Yt8fKL uS9iT7tCfp4h1ldO79JZVd7/r5b5RmijqKbMKTIoyFCSR9OFHk88MHURu FiCniTpbPYymJ5SH3YeoPDH/MqfqXEx7Wm9G6cujVG5rvwzyQ5tQ5/V5+ h1Evoa03BWXzXota0fgePY+jZCM+mI6EZ2CkbGr7rUEiCoyAYGzOzKRMd 9H0ajpSyHMxHCcqzcy9n2g0GpMdWTbD6fFkyprbgLV6e5YE6fnv6Wd5O5 A==; IronPort-SDR: 5GHqSiFtKgWIC8va82L+s6NuvHwV62gTUokLdXnoPAjLf5/HA5uwPqmcP00xXoVlF0HErxDLTG 9aLm3xM6vdtFRug26VdhIpctNXmcVVZ/IfHQL43hxYe3FijQxx6p+g6diKrDY4WJgjxUgydAmQ m1Rkuu5XoerHhbojxsEY/QGTsPcpUhhDi77/5WeWsgE46h+bjosOvGqQ5RhOXeMnwdPTysupA4 c0QvLKjHNmh1h0HP1r6VIPqUZxvZK64FulwW5Z3tR5rtef98cJW0byFBlYHWJehBKrOStYPJ0E scM= X-IronPort-AV: E=Sophos;i="5.73,387,1583218800"; d="scan'208";a="79436238" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 May 2020 05:56:06 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 13 May 2020 05:56:08 -0700 Received: from soft-dev15.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 13 May 2020 05:56:02 -0700 From: Lars Povlsen To: SoC Team , Arnd Bergmann , Stephen Boyd , Linus Walleij CC: Lars Povlsen , Steen Hegelund , Microchip Linux Driver Support , Olof Johansson , "Michael Turquette" , , , , , , Alexandre Belloni Subject: [PATCH 01/14] pinctrl: ocelot: Should register GPIO's even if not irq controller Date: Wed, 13 May 2020 14:55:19 +0200 Message-ID: <20200513125532.24585-2-lars.povlsen@microchip.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513125532.24585-1-lars.povlsen@microchip.com> References: <20200513125532.24585-1-lars.povlsen@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes the situation where the GPIO controller is not used as an interrupt controller as well. Previously, the driver would silently fail to register even the GPIO's. With this change, the driver will only register as an interrupt controller if a parent interrupt is provided. Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen --- drivers/pinctrl/pinctrl-ocelot.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index ed8eac6c14944..d4ac65b1efc0b 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -751,21 +751,21 @@ static int ocelot_gpiochip_register(struct platform_device *pdev, gc->of_node = info->dev->of_node; gc->label = "ocelot-gpio"; - irq = irq_of_parse_and_map(pdev->dev.of_node, 0); - if (irq <= 0) - return irq; - - girq = &gc->irq; - girq->chip = &ocelot_irqchip; - girq->parent_handler = ocelot_irq_handler; - girq->num_parents = 1; - girq->parents = devm_kcalloc(&pdev->dev, 1, sizeof(*girq->parents), - GFP_KERNEL); - if (!girq->parents) - return -ENOMEM; - girq->parents[0] = irq; - girq->default_type = IRQ_TYPE_NONE; - girq->handler = handle_edge_irq; + irq = irq_of_parse_and_map(gc->of_node, 0); + if (irq) { + girq = &gc->irq; + girq->chip = &ocelot_irqchip; + girq->parent_handler = ocelot_irq_handler; + girq->num_parents = 1; + girq->parents = devm_kcalloc(&pdev->dev, 1, + sizeof(*girq->parents), + GFP_KERNEL); + if (!girq->parents) + return -ENOMEM; + girq->parents[0] = irq; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_edge_irq; + } ret = devm_gpiochip_add_data(&pdev->dev, gc, info); if (ret) -- 2.26.2