From patchwork Tue Jul 18 22:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 704743 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 C3A97C001DC for ; Tue, 18 Jul 2023 22:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbjGRWa5 (ORCPT ); Tue, 18 Jul 2023 18:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbjGRWa4 (ORCPT ); Tue, 18 Jul 2023 18:30:56 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F5CBD; Tue, 18 Jul 2023 15:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689719455; x=1721255455; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=mQ/XSuCjEEjkILhFj9nOT74zfQbBcNaiX6hcd7hblIs=; b=fWhU4HuqOkm7jMjUnGPGXp4/xqAD+tm9z1xJp13XphqUkAPy2aTFdJ7v fE2mqHDlbmHJaKy2pD3R3Dlmt0HX08jrrLp6hFPlij6eiCxT0FfZPpDIy nw6UH0fY56J5DIJ0oh2Vp4FBGeC9hIBG2TiJojGjOPq3zjlxXjnxyKNGo BecB8Ivj84ZrDrPkmoDQDco8JLZDDHcF6UXxL3gdoIWrT6+sZcEWdE4wL SQuKedpTl+d76Tja1qFRoRP9OPzNhhfmM1EzEIabTmc8EXsM1qRc9iK7D sLdg5g9RswfhaYd5/00lUkvrkIT+IHSKuwQ7qukySkMAK22ZhU75SN0Dk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="346626709" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="346626709" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 15:30:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="727112101" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="727112101" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 18 Jul 2023 15:30:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E184E16E; Wed, 19 Jul 2023 01:30:58 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Ray Jui , Broadcom internal kernel review list , Florian Fainelli , Scott Branden Subject: [PATCH v3 1/3] gpio: bcm-kona: Make driver OF-independent Date: Wed, 19 Jul 2023 01:30:53 +0300 Message-Id: <20230718223055.2809-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org There is nothing in the driver that requires OF APIs, make the driver OF independent. Signed-off-by: Andy Shevchenko --- v2: new patch v3: fixed compilation error (LKP) drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-bcm-kona.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 638f0e771105..a70622d32a3b 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -191,7 +191,7 @@ config GPIO_RASPBERRYPI_EXP config GPIO_BCM_KONA bool "Broadcom Kona GPIO" - depends on OF_GPIO && (ARCH_BCM_MOBILE || COMPILE_TEST) + depends on ARCH_BCM_MOBILE || COMPILE_TEST help Turn on GPIO support for Broadcom "Kona" chips. diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 70770429ba48..c977144eff10 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -8,12 +8,14 @@ #include #include -#include #include -#include #include +#include #include #include +#include +#include +#include #define BCM_GPIO_PASSWD 0x00a5a501 #define GPIO_PER_BANK 32 @@ -556,19 +558,12 @@ static void bcm_kona_gpio_reset(struct bcm_kona_gpio *kona_gpio) static int bcm_kona_gpio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *match; struct bcm_kona_gpio_bank *bank; struct bcm_kona_gpio *kona_gpio; struct gpio_chip *chip; int ret; int i; - match = of_match_device(bcm_kona_gpio_of_match, dev); - if (!match) { - dev_err(dev, "Failed to find gpio controller\n"); - return -ENODEV; - } - kona_gpio = devm_kzalloc(dev, sizeof(*kona_gpio), GFP_KERNEL); if (!kona_gpio) return -ENOMEM; @@ -601,10 +596,10 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) chip->parent = dev; chip->ngpio = kona_gpio->num_bank * GPIO_PER_BANK; - kona_gpio->irq_domain = irq_domain_add_linear(dev->of_node, - chip->ngpio, - &bcm_kona_irq_ops, - kona_gpio); + kona_gpio->irq_domain = irq_domain_create_linear(dev_fwnode(dev), + chip->ngpio, + &bcm_kona_irq_ops, + kona_gpio); if (!kona_gpio->irq_domain) { dev_err(dev, "Couldn't allocate IRQ domain\n"); return -ENXIO; From patchwork Tue Jul 18 22:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 704181 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 5693FC001DE for ; Tue, 18 Jul 2023 22:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231356AbjGRWa5 (ORCPT ); Tue, 18 Jul 2023 18:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231199AbjGRWa4 (ORCPT ); Tue, 18 Jul 2023 18:30:56 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCE711992; Tue, 18 Jul 2023 15:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689719455; x=1721255455; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gci7SrqTXmudDsrVtfyn4d9ShON4LMyRPPd6NvIPQZQ=; b=QqXaeWueu/D8qQYKOVbebToCWNCqh41Qd9Yr19sAtl+ejMVel3BQId2E cGYdpk/oGoNdnkprXFzvSqjaYGgUF2bcJ08X5pJ2IxBVkidLr5mP4fYG+ rrOkxc8weye8zt5HcBd0sr2dJS9U/gaY3ISYiRsmvUmFoTCKqExzVRxtf 3oKP2vOUhXESex7DWCnhNlrUrudHQcYoIK5ht8AP3yVCJsdZWA8znBxiV c/rw02U4cnUBXlD/FWkbuisFyXj7miQ/iS4onaWVeibWABMzYxsgQYeAA q53wUk1hfccJmnH+sKRtglQPYO+3uO7XEGEU56IJjqyoeW5rhsC8YADNB w==; X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="366369827" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="366369827" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 15:30:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="793791445" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="793791445" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 18 Jul 2023 15:30:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id F121412C; Wed, 19 Jul 2023 01:30:58 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Ray Jui , Broadcom internal kernel review list , Florian Fainelli , Scott Branden , Andrei Coardos , Alexandru Ardelean Subject: [PATCH v3 2/3] gpio: bcm-kona: remove unneeded platform_set_drvdata() call Date: Wed, 19 Jul 2023 01:30:54 +0300 Message-Id: <20230718223055.2809-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230718223055.2809-1-andriy.shevchenko@linux.intel.com> References: <20230718223055.2809-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Andrei Coardos The platform_set_drvdata() call was never used, ever since the driver was originally added. It looks like this copy+paste left-over. Possibly the author copied from a driver that had this line, but also had a remove hook. Reviewed-by: Alexandru Ardelean Signed-off-by: Andrei Coardos Signed-off-by: Andy Shevchenko --- v2: no changes v3: no changes drivers/gpio/gpio-bcm-kona.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index c977144eff10..f67c0f76a196 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -592,7 +592,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) return -ENOMEM; kona_gpio->pdev = pdev; - platform_set_drvdata(pdev, kona_gpio); chip->parent = dev; chip->ngpio = kona_gpio->num_bank * GPIO_PER_BANK; From patchwork Tue Jul 18 22:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 704182 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 48BB6EB64DC for ; Tue, 18 Jul 2023 22:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbjGRWa4 (ORCPT ); Tue, 18 Jul 2023 18:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjGRWaz (ORCPT ); Tue, 18 Jul 2023 18:30:55 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4212B198E; Tue, 18 Jul 2023 15:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689719455; x=1721255455; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BiJCmzJbE53V+dnM+etuGHTrRreB4VKMv2OXfSndhuA=; b=Waqpc+PnWO1j6itIkPLhxpul5Ae0A5Cz/J+w6f69iHxbhtepPyohnyOL feVq0WMFxMekFGrPQojwGHfS19othXb5qAgs9HnYP72zai4aVTfZw+mWR lm+rZr/P22D0pmoNhY2xoYAqe2DcLKQe3U32dC3augctAlanVL6UXrnZh WRAVHoMWe084l+oXznjCKQUyscJSxqeVwrUANa02dvJNYgyEpYoU5ajdy XC/0lxUK7EnNTuVv3y4GLrLmB9AD3TUhPICbkJPtPAnohJfnrZxXTg2w9 5BRBqHCun2q56FM2jrF5aX7c86cW86SyLyUpN2S9yBFdYAUM8KQ+K0Cw4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="366369825" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="366369825" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 15:30:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="793791444" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="793791444" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 18 Jul 2023 15:30:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 06A601A5; Wed, 19 Jul 2023 01:30:58 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Ray Jui , Broadcom internal kernel review list , Florian Fainelli , Scott Branden Subject: [PATCH v3 3/3] gpio: bcm-kona: Drop unused pdev member in private data structure Date: Wed, 19 Jul 2023 01:30:55 +0300 Message-Id: <20230718223055.2809-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230718223055.2809-1-andriy.shevchenko@linux.intel.com> References: <20230718223055.2809-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The pdev member is assigned and not used, drop it. Signed-off-by: Andy Shevchenko --- v2: new patch v3: no changes drivers/gpio/gpio-bcm-kona.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index f67c0f76a196..5321ef98f442 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -64,7 +64,6 @@ struct bcm_kona_gpio { struct gpio_chip gpio_chip; struct irq_domain *irq_domain; struct bcm_kona_gpio_bank *banks; - struct platform_device *pdev; }; struct bcm_kona_gpio_bank { @@ -591,7 +590,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) if (!kona_gpio->banks) return -ENOMEM; - kona_gpio->pdev = pdev; chip->parent = dev; chip->ngpio = kona_gpio->num_bank * GPIO_PER_BANK;