From patchwork Mon Sep 2 13:30:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787311 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C49CCA0ED3 for ; Mon, 2 Sep 2024 13:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lTzkYI/fxRC89uKCDe2odrQ5Ty1tMpC5ZKK23AMIbd8=; b=SFAzPG6fJlbpQMrdsxjqA5ejVU Q1JQt3e80EVd+xTSLlR5BvNN48+YUY4inmNG/B6TwtZzTiFwrRhtUDCqHwPqltw1FC1gZliIBjfW2 nixN1VDIsoPtm+g1aARo/1LSr86rseS8MHihahGmdY1p477zjK0pYEXX21r3nQ/kvInDJEk6mUlGE /FNLncMflZboO5+ld+pbZkYjyf9eNAOEB6mRARHvSA0aqHVXKOoncvtCRKm4ywX7BTkWIwLKNOU0P sdgD2N+fiLmaCwn6f/+wKApEiR5OV1R6Fh4lAnpHyDZd5y0ioT+FKAqo6mD9Fhd83GUrG5kDSSqZV HSOmUVkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7FL-0000000EWZI-3exd; Mon, 02 Sep 2024 13:37:32 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7A5-0000000EV86-37Cb for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 13:32:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725283926; x=1756819926; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TOdIiE5tZOppfGkiAtqdeQ7Xsi+hc/W2Ft00cv2eZik=; b=ZqXMCe3g9xjL9zFKelskg+IuyBNvuaFVnXWze6krG1sBzXrkookjvmkz yYPzpdU9s8CdwRITzZxsdcZSBIMxzZZTg1N1IS6xoebFAFzP3kTNuy5vP CPlYNW3ItNO6iBKMtCrLWEkYn/xkGUPDSow3wbWfF8Ighgq1tlGvSgv5v ZdpOBI1u1WqoXI7kyWiM94zG7oD1D7xIkixKL9mSDRDxQijeblywZq4jt hCzBCO4AW77defeDVRq+Cl0bdi41NF5i9WekxV1ivQjtOSwdGDD5145PK znJz4NurmsZZ1ocTlm0Grra68WU+ZnEIRitl06rKtDYgzLzgNCHct2c6g w==; X-CSE-ConnectionGUID: SuhZ0vNtRgmoFLjUrutPKg== X-CSE-MsgGUID: xguv1bjtSp2tUwfJKcva7Q== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022579" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022579" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2024 06:32:02 -0700 X-CSE-ConnectionGUID: UdwefpfjQBKyswgyCVLfIA== X-CSE-MsgGUID: VvLoTozcSb+WvrB1eDpLyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="65114780" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 02 Sep 2024 06:31:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3FDD8233; Mon, 02 Sep 2024 16:31:58 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Maxime Coquelin , Alexandre Torgue Subject: [PATCH v1 1/5] gpio: stmpe: Fix IRQ related error messages Date: Mon, 2 Sep 2024 16:30:40 +0300 Message-ID: <20240902133148.2569486-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> References: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_063205_862701_CA6E60A1 X-CRM114-Status: GOOD ( 15.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org First of all, remove duplicate message that platform_get_irq() does already print. Second, correct the error message when unable to register a handler, which is broken in two ways: 1) the misleading 'get' vs. 'register'; 2) missing '\n' at the end. (Yes, for the curious ones, the dev_*() cases do not require '\n' and issue it automatically, but it's better to have them explicit) Fix all this here. Fixes: 1882e769362b ("gpio: stmpe: Simplify with dev_err_probe()") Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index abd42a975b09..4e171f9075bf 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -464,6 +464,7 @@ static void stmpe_gpio_disable(void *stmpe) static int stmpe_gpio_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); struct device_node *np = pdev->dev.of_node; struct stmpe_gpio *stmpe_gpio; @@ -493,12 +494,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev) of_property_read_u32(np, "st,norequest-mask", &stmpe_gpio->norequest_mask); - irq = platform_get_irq(pdev, 0); - if (irq < 0) - dev_info(&pdev->dev, - "device configured in no-irq mode: " - "irqs are not available\n"); - ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO); if (ret) return ret; @@ -507,6 +502,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) if (ret) return ret; + irq = platform_get_irq(pdev, 0); if (irq > 0) { struct gpio_irq_chip *girq; @@ -514,8 +510,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) stmpe_gpio_irq, IRQF_ONESHOT, "stmpe-gpio", stmpe_gpio); if (ret) - return dev_err_probe(&pdev->dev, ret, - "unable to get irq"); + return dev_err_probe(dev, ret, "unable to register IRQ handler\n"); girq = &stmpe_gpio->chip.irq; gpio_irq_chip_set_chip(girq, &stmpe_gpio_irq_chip); From patchwork Mon Sep 2 13:30:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787309 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15373CD342A for ; Mon, 2 Sep 2024 13:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Px/UY4NxaYs/EE31AJ7jPoeYevIxLvYXTw0KecKZjro=; b=rEwIhJKnRNspQZOdEcO1RFzyRC GAteOeRkqKtbtvpyhSOc15QETdlezFrcmkPM8/t535mO+5qnPFDp3IpliGgVeyvytp4ziHrIdTiu+ lXMfEsdF8XaoZvq3v7Lt3cIGkKrr1N7OxTm9f3Atynx7HGPb7AL/z5aQ7A+YXZY2Ylhm/mO4M3TOX y0wo/gb+7T7HBuZggXY41cbmReuUPEGKoBm+gWPs1GLXKRc5oHltPpiHEG5HNTxH5w3rw2JQA2kM6 2s2HUilRHcaErmcc8pLEVaNovt21FhEBuHp5Jr7Fc8/KsKT0cRnQSW3Wl0bgbkNOwsGZ7fRbQD1lR vsrJJrXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7Da-0000000EW3f-0Is7; Mon, 02 Sep 2024 13:35:42 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7A4-0000000EV8h-22sU for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 13:32:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725283925; x=1756819925; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7XH+G1Xb/vD8vf0GcakPf1WizXUz/rhT3tCc+q7JEcU=; b=ZPgaLcr7eyBcWIHTdt1Q7kIfXHXuTzEFgaOPNKeFfzFcQxkjfad/bdJy et8CuSOblrHRaEzyXwZ5Lk2OVSLR8jzejxS0FqL5YW9c1hnzLJgVkrkNe bk3Dp5vIEkx/Bm4hg79u09p2XOmO0M9T+G6O9BSidDpSq8jwU1nRAgGDb D6JIqnqKYrQ0i42KlPHq9TkrOr41krBXKeuB5nAVQFK+STg2d7L0k+odJ npyG2Z/YsBEil10pbdaO9x/PxNQxjcaWAoe/tsPBZV4FK7+0bFxugcMgZ TVB5OaPGTOUhvP+e3W0BN+UBnrJUHZEeoL7ayMGJ4/AXRFfFruuC9NkD4 A==; X-CSE-ConnectionGUID: p0QlQNmWTpm+xr+XcdElMg== X-CSE-MsgGUID: c+k4EH8hQ9a4kwcnBv6v6A== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022572" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022572" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2024 06:32:02 -0700 X-CSE-ConnectionGUID: M+jjVR5wQYCMPQ+GdDN7Yw== X-CSE-MsgGUID: fmyiHwNASM6OuAbg2JE87w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="65114779" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 02 Sep 2024 06:31:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 48B883BA; Mon, 02 Sep 2024 16:31:58 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Maxime Coquelin , Alexandre Torgue Subject: [PATCH v1 2/5] gpio: stmpe: Remove unused 'dev' member of struct stmpe_gpio Date: Mon, 2 Sep 2024 16:30:41 +0300 Message-ID: <20240902133148.2569486-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> References: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_063204_696134_7E498B91 X-CRM114-Status: GOOD ( 10.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is no evidence that the 'dev' member of struct stmpe_gpio is used, drop it. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 4e171f9075bf..99f1482b2ab3 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -31,7 +31,6 @@ enum { LSB, CSB, MSB }; struct stmpe_gpio { struct gpio_chip chip; struct stmpe *stmpe; - struct device *dev; struct mutex irq_lock; u32 norequest_mask; /* Caches of interrupt control registers for bus_lock */ @@ -481,7 +480,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev) mutex_init(&stmpe_gpio->irq_lock); - stmpe_gpio->dev = &pdev->dev; stmpe_gpio->stmpe = stmpe; stmpe_gpio->chip = template_chip; stmpe_gpio->chip.ngpio = stmpe->num_gpios; From patchwork Mon Sep 2 13:30:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787308 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BAF7CA0ED3 for ; Mon, 2 Sep 2024 13:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FEamoWTaz/lqIXphALzTz6swVb2wOW+ZuKPqMz+C9jk=; b=m3uVczB0mLgT1GauhWpNlqPr7Z Et2E+YRCTP53gP0tZkKJgBxsCdzpeH4aA78M0e1QQWcgNELnBTxcIg+DZ1Q8QtSW4SQk7M4Cqa688 Z2mFK29pzJbrnnBZTfTQpNQvycbfK4rYVHZWec7XrrkkodTuNB4SNr0hflUYsVTo91BTRxwBtSGDH tewioNMPgqKMYcwDc+xz52DL7cF4CKqzbypGaZ3aMNPWnQPtNo4bE7Dt4urPaXkgHb+lB5z2z3Fhb 9z46hmQgOtbb0D2XlMvTRd3zPG7v67E2jiVIgCz+jy9UijHs5I0RmgQR6zVdXM96x6sJW99A9M1sT JHiFg/mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7Ce-0000000EVrL-23mn; Mon, 02 Sep 2024 13:34:44 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7A4-0000000EV86-0cOF for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 13:32:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725283924; x=1756819924; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sarn8u6DMiqscknv9atERVdrT9dOoz1FqQ1plDaPSJQ=; b=OXC8DkdI0ogHiPsIEFjgKUfquqvslf6tBzKjnCYVu+Dc2vOrEcPk0chh fV90o76Ir+oUH0MMJJq5KP/NyxIbX9CHZSyaUOxwgyLN6Kfw1bwc0xpMG KpK/QwSkVJQuHLo8kYaf88mU96NxOzRfDgcH6cEG4ckleoxZZ+NWLyqN6 0q45RjgxdsSoT1TPk9vdYn2OSxudokBmToGD6B7wai+nGRSwGsKhRaKo/ 9cSMS56J07gRnAnsMcdTuvOsvI1VxR1Hnu/rCH2bjhvpospEnAGshZAkh y8SiYyk0lxCoSbpS2SZwf8EI0wc15iVB1p16CTmvI7rydC+0wwW3C4aYk w==; X-CSE-ConnectionGUID: W8k2/RfWS6+uZEE6o8pXkg== X-CSE-MsgGUID: dWDBFqH9RrWzjcUMkYpVbg== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022559" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022559" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2024 06:32:02 -0700 X-CSE-ConnectionGUID: hqDPdlbRRteXWf3gwuVu5A== X-CSE-MsgGUID: qV7iHiwEQIOGNMeFdrM7kw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="65114777" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 02 Sep 2024 06:31:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 570F348C; Mon, 02 Sep 2024 16:31:58 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Maxime Coquelin , Alexandre Torgue Subject: [PATCH v1 3/5] gpio: stmpe: Utilise temporary variable for struct device Date: Mon, 2 Sep 2024 16:30:42 +0300 Message-ID: <20240902133148.2569486-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> References: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_063204_266726_305E6189 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We have a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 99f1482b2ab3..7f2911c478ea 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -464,17 +464,17 @@ static void stmpe_gpio_disable(void *stmpe) static int stmpe_gpio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); - struct device_node *np = pdev->dev.of_node; + struct stmpe *stmpe = dev_get_drvdata(dev->parent); + struct device_node *np = dev->of_node; struct stmpe_gpio *stmpe_gpio; int ret, irq; if (stmpe->num_gpios > MAX_GPIOS) { - dev_err(&pdev->dev, "Need to increase maximum GPIO number\n"); + dev_err(dev, "Need to increase maximum GPIO number\n"); return -EINVAL; } - stmpe_gpio = devm_kzalloc(&pdev->dev, sizeof(*stmpe_gpio), GFP_KERNEL); + stmpe_gpio = devm_kzalloc(dev, sizeof(*stmpe_gpio), GFP_KERNEL); if (!stmpe_gpio) return -ENOMEM; @@ -483,7 +483,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) stmpe_gpio->stmpe = stmpe; stmpe_gpio->chip = template_chip; stmpe_gpio->chip.ngpio = stmpe->num_gpios; - stmpe_gpio->chip.parent = &pdev->dev; + stmpe_gpio->chip.parent = dev; stmpe_gpio->chip.base = -1; if (IS_ENABLED(CONFIG_DEBUG_FS)) @@ -496,7 +496,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) if (ret) return ret; - ret = devm_add_action_or_reset(&pdev->dev, stmpe_gpio_disable, stmpe); + ret = devm_add_action_or_reset(dev, stmpe_gpio_disable, stmpe); if (ret) return ret; @@ -504,9 +504,8 @@ static int stmpe_gpio_probe(struct platform_device *pdev) if (irq > 0) { struct gpio_irq_chip *girq; - ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, - stmpe_gpio_irq, IRQF_ONESHOT, - "stmpe-gpio", stmpe_gpio); + ret = devm_request_threaded_irq(dev, irq, NULL, stmpe_gpio_irq, + IRQF_ONESHOT, "stmpe-gpio", stmpe_gpio); if (ret) return dev_err_probe(dev, ret, "unable to register IRQ handler\n"); @@ -522,7 +521,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) girq->init_valid_mask = stmpe_init_irq_valid_mask; } - return devm_gpiochip_add_data(&pdev->dev, &stmpe_gpio->chip, stmpe_gpio); + return devm_gpiochip_add_data(dev, &stmpe_gpio->chip, stmpe_gpio); } static struct platform_driver stmpe_gpio_driver = { From patchwork Mon Sep 2 13:30:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787307 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1E1FCD13CF for ; Mon, 2 Sep 2024 13:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JeERiVN2oIkzAFy4MEh5DuiasAZ7ilk+Ri2ju8LIAwU=; b=pVpHnR8jxGA0AuGaY3GLgUiIQY zhMbroZ8bWmk+PcMoDf9e76NRAFgvFcltAp3vn+qUg0hLJd6dcdi/Bj/vV/O9AQ3rmXAwZyBy6ZvL BVjzyAuLRkV/2GV7/sPwi3Mzwawy1+GmNbL7AZbkuJSOI0rvniMGjSxG7nfEcXp4P2oWLd+7LnpV2 YLd4SksVtGI8HDttoiRqm1nTC4B+NzEDFCxdG3H7TkW7Vkcm5K4jkcY+u78Nm20hXLj53ADc8oaZP qt/9E1xfieN7rUucAKC60TPca32n83sUotG8uzv7eoewfxQJAjT9UmHXvMFMysjK4KWYhy18n0Wt6 bvNWCr+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7Bm-0000000EVeY-02Fr; Mon, 02 Sep 2024 13:33:50 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7A2-0000000EV86-31No for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 13:32:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725283923; x=1756819923; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f+HzvJdgV9PfmdoJ0kwbhBMaeKBv9YJV29ZR+z0+n+c=; b=EuGjUvO1Zq1nqB+iF7Qcz+QIN7F5AmbdNyNvMtHCcYKnpJOakRgCNOwR 16r2QyO2twtjG5BBiC38Q8663nPPYIRiv4Jviecz9In9hdpjug5KaFXN/ lUflovU371tBPiUUMfy5QAOOqv0eX6bTVJkJDrYmvaa3DR/TuMdFnNJOx Ga+kSnQziSTHO+i/8seb7ACSzdipuyCa5+yWaHi2jU+ydLGdPv2Vgml2H rnS8Q8hmp5nta1zeM7qFVpqUv22ZBsHWWaHneNH+oC2d1hBqywKPucxLH QpyImzzxzXuNtlBHpfeD8/vSbFjS3kZnXB9FQTW6RIa7Wr43A/PaHc0HF Q==; X-CSE-ConnectionGUID: a/Syg4OxR8a+51ueZPg+pA== X-CSE-MsgGUID: 5i9JNdBTSHW2y3TQqKYr2Q== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022565" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022565" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2024 06:32:02 -0700 X-CSE-ConnectionGUID: 8M/PgchhQveOGHNJhOHeFw== X-CSE-MsgGUID: 6hIwSaeFQmqwfnCItnBdhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="65114778" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 02 Sep 2024 06:31:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 669EC48D; Mon, 02 Sep 2024 16:31:58 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Maxime Coquelin , Alexandre Torgue Subject: [PATCH v1 4/5] gpio: stmpe: Make use of device properties Date: Mon, 2 Sep 2024 16:30:43 +0300 Message-ID: <20240902133148.2569486-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> References: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_063202_821661_AFA8A742 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 7f2911c478ea..c1fb06925e09 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include #include @@ -465,7 +465,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct stmpe *stmpe = dev_get_drvdata(dev->parent); - struct device_node *np = dev->of_node; struct stmpe_gpio *stmpe_gpio; int ret, irq; @@ -489,8 +488,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) if (IS_ENABLED(CONFIG_DEBUG_FS)) stmpe_gpio->chip.dbg_show = stmpe_dbg_show; - of_property_read_u32(np, "st,norequest-mask", - &stmpe_gpio->norequest_mask); + device_property_read_u32(dev, "st,norequest-mask", &stmpe_gpio->norequest_mask); ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO); if (ret) From patchwork Mon Sep 2 13:30:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787310 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7EAFBCA0ED3 for ; Mon, 2 Sep 2024 13:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vAK7ANrm4zZNRRIm8BN5n4fZ3Kv1f9K8jJQuJDaJB/c=; b=dcT2DDtE+tMO13hjEeISk1efWe Talr72Q0hCCDJaxNTl0B19oz0C4/BhfyrKBDovgmHio3WsxTwCySzhiea/v33/LAfKEezCN4a4MB4 jqbUaPmgr3E3Z8z3OzcCnpqKY1xFUtOyKHscd1k7ppoSyt+4ztJDLLrcxFgYfGbYzTZF2psfPwMmi ZNJS8ghoi0cRfJLMERsiBCo0o58AedxT1f09/364kEdAVXVE/u++qeaDCQ4A9BZcf3/Ba8X57EtfH PwvXFr2B1OOD/aIsTwoRfYUAxupk9OLevpLRkm03iHN/PnW4D2Nt7/h8chkK9voV+IC15vLnmw+HJ 6lkDct3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7EU-0000000EWNX-3cFd; Mon, 02 Sep 2024 13:36:38 +0000 Received: from mgamail.intel.com ([192.198.163.8]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl7A5-0000000EV9C-1zse for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 13:32:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725283926; x=1756819926; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BSXDsgKfV65tn6E/T8L5w0XQjbUaQBnlDePaCFf+QeQ=; b=EfoTAfyrkEVBObQJKDwprB3LLgN8vqgQQZuN4JI3qxvDCL/JegeoUMVU xCpqFEvLTt4vtzK2G/mcu0YGYJE77vaT8Tvfr43cm/sGtj5s0IIxKeh4L pbGN6uQng4fP9tZN3quHUZLzjwKvvljeRmmrL4Rnh80NZ+yyZ38FESkAH bSe0WJEfYtxFZUxPkeN+kkeWPPmvB9sQ7jXfMdzEBINtyyZ1aKXR418pX 1LXmOLBsIJha9Jcw+i8iCzmUwr0/4mynN9xrk0rqoMbToc8tCwMjEsJGt GMjygWyHtDYUIhz/NzcqEZOnqidg/r0Cnho3L6PLaqLPDZvzrvqakh4/C w==; X-CSE-ConnectionGUID: 8gAHwDYOTtifbrb01xVHZg== X-CSE-MsgGUID: yTWpZ19KSP2nIaltJJBmvg== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="41364554" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="41364554" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2024 06:32:02 -0700 X-CSE-ConnectionGUID: Xo8z+4PHS7eblkAJoP8AUg== X-CSE-MsgGUID: BkoQAzn0TTGgZ3P7+2BLEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="64293993" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 02 Sep 2024 06:31:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 792E4AF3; Mon, 02 Sep 2024 16:31:58 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Maxime Coquelin , Alexandre Torgue Subject: [PATCH v1 5/5] gpio: stmpe: Sort headers Date: Mon, 2 Sep 2024 16:30:44 +0300 Message-ID: <20240902133148.2569486-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> References: <20240902133148.2569486-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_063205_545201_68129986 X-CRM114-Status: GOOD ( 10.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Sort the headers in alphabetic order in order to ease the maintenance for this part. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index c1fb06925e09..75a3633ceddb 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -5,16 +5,16 @@ * Author: Rabin Vincent for ST-Ericsson */ +#include #include -#include -#include -#include #include +#include #include #include #include +#include #include -#include +#include /* * These registers are modified under the irq bus lock and cached to avoid