From patchwork Thu Mar 3 20:37:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 548384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2820C433FE for ; Thu, 3 Mar 2022 20:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbiCCUfd (ORCPT ); Thu, 3 Mar 2022 15:35:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236155AbiCCUfc (ORCPT ); Thu, 3 Mar 2022 15:35:32 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 903A6EEA57; Thu, 3 Mar 2022 12:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646339686; x=1677875686; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tM8jBlIUkxhKyQ0W8V73UEcthIfQ+McOciGDrTycFHk=; b=m4Y6f2Lv0QuKpjxncX68+gAbbgATbgbSSchsGQmp+egOUTteqSG+oL5U sysgPocoIziiD8WGB3T5otS31UykdqeGl9AznxYObsWbkFQqS8dtTGh1F 9UpZhM7KtC0e/8+p4JKOPqXB4dsqVmcQ+8ruDDBh7cvKJUaMHB5pSaPxU EylMVK1tkbLag+FpLb3XRvFO3uWulBfqb3yfUW2GEYiXN8KfKnXnYDOPo Af/gOEVWndwEbs6I50TeayjCaWicO2JS5eSkD9eT0iEahk/gPixHCS/Ev OrgQ24cXUNfVeBObaea+ClF4zscfUVxqqwqfrFjXx8rF31kzwBsV/Q5tC g==; X-IronPort-AV: E=Sophos;i="5.90,153,1643698800"; d="scan'208";a="150780458" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Mar 2022 13:34:45 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 3 Mar 2022 13:34:45 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 3 Mar 2022 13:34:44 -0700 From: Horatiu Vultur To: , CC: , , , Horatiu Vultur Subject: [PATCH 1/2] pinctrl: ocelot: Fix the pincfg resource. Date: Thu, 3 Mar 2022 21:37:15 +0100 Message-ID: <20220303203716.3012703-2-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220303203716.3012703-1-horatiu.vultur@microchip.com> References: <20220303203716.3012703-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The pincfg resources are in the second memory resource. But the driver still tries to access the first memory resource to get the pincfg. This is wrong therefore fix to access the second memory resource. Fixes: ad96111e658a95 ("pinctrl: ocelot: combine get resource and ioremap into single call") Signed-off-by: Horatiu Vultur --- drivers/pinctrl/pinctrl-ocelot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 685c79e08d40..a859fbcb09af 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -1892,7 +1892,7 @@ static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev) .max_register = 32, }; - base = devm_platform_ioremap_resource(pdev, 0); + base = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(base)) { dev_dbg(&pdev->dev, "Failed to ioremap config registers (no extended pinconf)\n"); return NULL; From patchwork Thu Mar 3 20:37:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 547956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 056A6C4332F for ; Thu, 3 Mar 2022 20:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236304AbiCCUff (ORCPT ); Thu, 3 Mar 2022 15:35:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236299AbiCCUfe (ORCPT ); Thu, 3 Mar 2022 15:35:34 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E66EEA65; Thu, 3 Mar 2022 12:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646339688; x=1677875688; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F1/s1mP5Lcx/uFwwtY6gQcRqc063q6v7LM6wZ1JFe00=; b=rIzeijlbh2MkY4P6UAJsoLuORvlDlEaC4mOULaESBdN5AKVQ7qbnq991 uhAqzrBOXVNpul39YpXzviHyn285Io8EcLden9cpkB9k0RmF0DP9ViBCD X6LJqXij+29X1eQ3K5Vc+Ydju7hse8vUtbJ7RMBaZphM/jKxhGkSscbaR 69lTa/mLyjKD/HjDM9nl218MoSCzxDcCJdyLKXmbFTncznQsPR/w4vSZj vwSCu+YIX9a73sgYkb1xYise8z1AZln3VfSIst5gAPqhIlQIBYRMQqNAi 3FsPjX9WEXDeOAoiliBEy571u7gP2QxlaR70zrKgbuQETdKwSRSqLxeK1 g==; X-IronPort-AV: E=Sophos;i="5.90,153,1643698800"; d="scan'208";a="155638920" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Mar 2022 13:34:47 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 3 Mar 2022 13:34:47 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 3 Mar 2022 13:34:46 -0700 From: Horatiu Vultur To: , CC: , , , Horatiu Vultur Subject: [PATCH 2/2] pinctrl: ocelot: Fix interrupt parsing Date: Thu, 3 Mar 2022 21:37:16 +0100 Message-ID: <20220303203716.3012703-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220303203716.3012703-1-horatiu.vultur@microchip.com> References: <20220303203716.3012703-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org In the blamed commit, it removes the duplicate of_node assignment in the driver. But the driver uses this before calling into of_gpio_dev_init to determine if it needs to assign an IRQ chip to the GPIO. The fixes consists in using of_node from dev. Fixes: 8a8d6bbe1d3bc7 ("pinctrl: Get rid of duplicate of_node assignment in the drivers") Signed-off-by: Horatiu Vultur --- drivers/pinctrl/pinctrl-ocelot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index a859fbcb09af..a0f00380e700 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -1851,7 +1851,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev, gc->base = -1; gc->label = "ocelot-gpio"; - irq = irq_of_parse_and_map(gc->of_node, 0); + irq = irq_of_parse_and_map(info->dev->of_node, 0); if (irq) { girq = &gc->irq; girq->chip = &ocelot_irqchip;