From patchwork Mon Jul 24 16:13:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 705919 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 A699DC001B0 for ; Mon, 24 Jul 2023 16:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231292AbjGXQNb (ORCPT ); Mon, 24 Jul 2023 12:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230398AbjGXQN0 (ORCPT ); Mon, 24 Jul 2023 12:13:26 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CFA610DC; Mon, 24 Jul 2023 09:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690215203; x=1721751203; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=q9NRNMG34ThGTaFRAgzsbGNmmuVIUJha9nRtnT1HMq4=; b=K9HjVPwTc4DMYO5Gxvdyzo/w9aT5laYxyPROIhfgPDN/Jsfk5vSNcP22 nQLeSEZ5FRDuvt2DBQuNHB3MdvQHJY97qIUEgcpOGrq6hC42Ia90OLveJ WT8xpbufaP5pSTcvWBm3IurJisI2wCBh1ITPfEul99cvTRTX98z8S1dlQ vIrrY32QM4yDs2iGdHo7LHmOk06oZ2O3OoBTyUqfaqMFDKoQOsgJxZ7FL 3vQWVRXip/g1NmIaJxr9Jc0ss7bqcvoIu5ePtmZdp6+/OYsceod5qmHrf NwZAKiXr0bvH6YvBqx83xv3HULRwy7atqrJEZ4YSEguT1oghc69RmJkRR w==; X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="347089844" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="347089844" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 09:13:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="815884109" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="815884109" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 24 Jul 2023 09:13:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 71F52195; Mon, 24 Jul 2023 19:13:21 +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 , Randy Dunlap Subject: [PATCH v1 1/6] gpio: ge: Add missing header Date: Mon, 24 Jul 2023 19:13:15 +0300 Message-Id: <20230724161320.63876-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> References: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add missing platform_device.h that used to be implied by of_device.h. While at it, sort headers alphabetically for better maintenance. Reported-by: Randy Dunlap Fixes: e91d0f05e66a ("gpio: Explicitly include correct DT includes") Closes: https://lore.kernel.org/r/65b4ac1a-1128-6e2a-92c0-9bbcca4b760a@infradead.org Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-ge.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c index 4eecbc862abc..ecadb81ce7f8 100644 --- a/drivers/gpio/gpio-ge.c +++ b/drivers/gpio/gpio-ge.c @@ -17,13 +17,14 @@ * the I/O interrupt controllers mask to stop them propergating */ -#include +#include #include -#include -#include -#include +#include #include -#include +#include +#include +#include +#include #define GEF_GPIO_DIRECT 0x00 #define GEF_GPIO_IN 0x04 From patchwork Mon Jul 24 16:13:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 705921 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 0B504C001B0 for ; Mon, 24 Jul 2023 16:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbjGXQNS (ORCPT ); Mon, 24 Jul 2023 12:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbjGXQNR (ORCPT ); Mon, 24 Jul 2023 12:13:17 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DD010CB; Mon, 24 Jul 2023 09:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690215196; x=1721751196; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OvpuSgu/bv4KjS8fI5f2MwtNglY+5tuG7uCAwPmElOg=; b=KEgwWAPUnDd0G6xFTc70c5miJ7PG4AVLAts9g5LUHt9ljBt13L/R6faC 0iLW27eN875JDd70tPku3KtJ3pezuQTHF5duhk2MTPxid2h6FPEWy2tpz xRZXAo9opBzwGQzdHWTiOqJRPEt12Ltvpi324xvECT3cyLk6LiPbiIKpF ec0oFUlwOiMGcIFAtp3buAXcdVoNRCRoNH3mnXFNH1X+Zap/PUuCgdxgA UejvILgWJ48/GFkzdsd+HDjvpCSarY1nJmxM67ruR3R80xgz2YmyI/EbD p43lajsnabePDy9LakUQNsjgnycHX6hKYdu3KEDzWork7UCsNpOVI2PcY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="364945368" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="364945368" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 09:13:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="702949233" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="702949233" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 24 Jul 2023 09:13:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 923692FF; Mon, 24 Jul 2023 19:13:21 +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 Subject: [PATCH v1 4/6] gpio: ge: Utilise temporary variable for struct device Date: Mon, 24 Jul 2023 19:13:18 +0300 Message-Id: <20230724161320.63876-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> References: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org We have a temporary variable to keep pointer to struct device. Utilise it inside the ->probe() implementation. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-ge.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c index d019669048e6..268de5496fcb 100644 --- a/drivers/gpio/gpio-ge.c +++ b/drivers/gpio/gpio-ge.c @@ -59,7 +59,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev) void __iomem *regs; int ret; - gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL); + gc = devm_kzalloc(dev, sizeof(*gc), GFP_KERNEL); if (!gc) return -ENOMEM; @@ -67,9 +67,9 @@ static int __init gef_gpio_probe(struct platform_device *pdev) if (IS_ERR(regs)) return PTR_ERR(regs); - ret = bgpio_init(gc, &pdev->dev, 4, regs + GEF_GPIO_IN, - regs + GEF_GPIO_OUT, NULL, NULL, - regs + GEF_GPIO_DIRECT, BGPIOF_BIG_ENDIAN_BYTE_ORDER); + ret = bgpio_init(gc, dev, 4, regs + GEF_GPIO_IN, regs + GEF_GPIO_OUT, + NULL, NULL, regs + GEF_GPIO_DIRECT, + BGPIOF_BIG_ENDIAN_BYTE_ORDER); if (ret) return dev_err_probe(dev, ret, "bgpio_init failed\n"); @@ -82,7 +82,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev) gc->ngpio = (uintptr_t)device_get_match_data(dev); /* This function adds a memory mapped GPIO chip */ - ret = devm_gpiochip_add_data(&pdev->dev, gc, NULL); + ret = devm_gpiochip_add_data(dev, gc, NULL); if (ret) return dev_err_probe(dev, ret, "GPIO chip registration failed\n"); From patchwork Mon Jul 24 16:13:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 705920 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 6E2CFC001B0 for ; Mon, 24 Jul 2023 16:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbjGXQNU (ORCPT ); Mon, 24 Jul 2023 12:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjGXQNT (ORCPT ); Mon, 24 Jul 2023 12:13:19 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BD310C1; Mon, 24 Jul 2023 09:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690215199; x=1721751199; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mQmhwRMCX+2VlBlAQk2QrEayonYigV1tJYv2ecQydMk=; b=a2PhMs8IoPPnDCTOpFffWyj1li7XSuA0USklQxzXjNp8p7XJzMVmZkGx 1dpUaA/Hpx2Kjvp4YIZxABjHcPuNr/x4qz/1lOnQdXkmsAM8GwCI8+kna 5EQKl6jgq8TbJ4PGf/t35QHOLYktxCb26A3xCn8qYwyB1fWKKucajaP0+ VlSDciwXs+WWzWLinT4KNrv1I9pPda4HGfivoiUvBZ003dIO9ylcnBR1C 3/Gqi8K8qipW7+CGaRToJFandyr5syOIMMyeNNcDK5AUBaQS4D/V/Fp6F 0in2svQ7po7rUX8qLBRMw0PpJrCTjgwJNm1rk5nvEbzmBtp1tXZqLC9W5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="364945380" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="364945380" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 09:13:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="702949237" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="702949237" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 24 Jul 2023 09:13:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9D99330D; Mon, 24 Jul 2023 19:13:21 +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 Subject: [PATCH v1 5/6] gpio: ge: Replace GPLv2 boilerplate with SPDX Date: Mon, 24 Jul 2023 19:13:19 +0300 Message-Id: <20230724161320.63876-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> References: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Replace the GPLv2 boilerplate text with a nice and short SPDX header. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-ge.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c index 268de5496fcb..5dc49648d8e3 100644 --- a/drivers/gpio/gpio-ge.c +++ b/drivers/gpio/gpio-ge.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Driver for GE FPGA based GPIO * * Author: Martyn Welch * * 2008 (c) GE Intelligent Platforms Embedded Systems, Inc. - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. */ /* From patchwork Mon Jul 24 16:13:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 705918 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 1D389C001DF for ; Mon, 24 Jul 2023 16:13:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbjGXQNh (ORCPT ); Mon, 24 Jul 2023 12:13:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231159AbjGXQNa (ORCPT ); Mon, 24 Jul 2023 12:13:30 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1318D10FD; Mon, 24 Jul 2023 09:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690215205; x=1721751205; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RG8VsiElN3tPMSruZOdFSG7H2jFBx3bqqLi4H8oXmwQ=; b=c43s9KzwC4j6PVYEZFZy9KkHf3YzsSWeVUvuS+n+eg837yeDgPuUsx67 wVRj173ICg7J66WEdUK3LJlCJsXPo12r0kcaoivwLgvxUl0jU3pdIUHw3 Q8aEJwWRV9yf/MZxtho7bUASxbOQqOwk5Pbs1GCL0mf2kaatO2nlLQy+V NZ+hFHwEU7FoybRG2R3EjA/A/I+h1Ao9iKZgYjDQA6AC2ncYY6MhiPc0G +/cOpHvR5/DcY1FxfruxA8L4g2wyXe5yZedmmkTPFrQhBjs0q4YurWXoK ntXkboWvZ8Rx0b6RP4kXx5tL0MX69EqzEpH1D+DIVkmB2KWVn6nH9WPxr g==; X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="347089871" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="347089871" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 09:13:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="815884111" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="815884111" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 24 Jul 2023 09:13:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A5116376; Mon, 24 Jul 2023 19:13:21 +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 Subject: [PATCH v1 6/6] gpio: ge: Enable COMPILE_TEST for the driver Date: Mon, 24 Jul 2023 19:13:20 +0300 Message-Id: <20230724161320.63876-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> References: <20230724161320.63876-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Driver is so simple, yet there was a room for mistakes. Reduce their appearance in the future by enabling COMPILE_TEST option. Signed-off-by: Andy Shevchenko --- drivers/gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 7d41f59d21d8..5981ad290c6e 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -282,7 +282,7 @@ config GPIO_EXAR config GPIO_GE_FPGA bool "GE FPGA based GPIO" - depends on GE_FPGA + depends on GE_FPGA || COMPILE_TEST select GPIO_GENERIC help Support for common GPIO functionality provided on some GE Single Board