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: 824721 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 933BC20FABF; Mon, 2 Sep 2024 13:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283926; cv=none; b=sC9zDkFBbJRmffTxcCk2o8u0mQVq9PGixfFQqA5dXItn9bTdcIBILhhiJZ2k247YtYRIHfB410XSx1SLjQkMv0YI1i4sT9IBm4W0enxQcyE1dZ9Q59OMq5T/2NBa5w5u9uLN/taH8TD7WfMDNsq3gOLXAQ+1Df4N4xhcizk97o0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283926; c=relaxed/simple; bh=TOdIiE5tZOppfGkiAtqdeQ7Xsi+hc/W2Ft00cv2eZik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZA4fEynh4okpy1pFIlNY/TsqmGELQnwNE3Qt6okZxrly6h1/TZHPDen0gwxj3HD44KukPNPu3KmAAzQpgJOZJYgtpSOU+eFONVMgNPBH8GICglAotbfuh/L3UOjDKSO+PfUQybgxgSqGDiB1jDjQ0Rsl8/1+TYzoQc+xDGnEPkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hBkBq1Kr; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hBkBq1Kr" 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=TOdIiE5tZOppfGkiAtqdeQ7Xsi+hc/W2Ft00cv2eZik=; b=hBkBq1Krkm6+6VRWl1cXu5kg9ziFu3NmUXaLAQ2nM8dVHQAjpGXBhtHi +bb9kZwT/9ACLDs5q9CndTAFSAiEOgBG8H1ygnQgr534aeCBmadxZITuB lfGLSpCljkrHavDVgnkdl+DuidZAJrS+TTbtqUKhlLiMU5huzAvWrpejx IomAqkijdA38hOpBQZHkxOLf2lL67A2Bkw0L1CmCLM0rt3bbrgGl6gv8r 11fGPekP1b1/xkAHkdxo2VL8E4TOVNj2jjuHK2I2ojHxzbjE/uwFqs02T hg+LLdPQ/8hvCynGL8tCB48aYWQ2Bjlw7hEAbj+udgZt5GuzSii9pWWdS w==; X-CSE-ConnectionGUID: X1yRjw/QSpKQ8Boh8iyxZQ== X-CSE-MsgGUID: NnRiflPqTyyieNH/ZEWOsA== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022580" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022580" 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- 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: 825080 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4173C10A0E; Mon, 2 Sep 2024 13:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283925; cv=none; b=FXY199DsjhaGhJpKvTBJCUxpqTIdkppjNCuR/+qc8WCjWZ2mFTQaC6du55l6QVKn5uZn4DP2S3TTNIAwICiXCvdmvSkF4LuQF6U6guU2eIcp/jBAKPT5InxsctqoYlssUrh5tMx1PGjQ/EB7qEt9c1ilBWe5emUzTqGVu9sbIPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283925; c=relaxed/simple; bh=7XH+G1Xb/vD8vf0GcakPf1WizXUz/rhT3tCc+q7JEcU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pm54PrQdhwQpqHmDHCpu9F9FUaSVevEZpjXzJcTWBLUEaSg0mQW6/0ck6TarYG+8ofpvF5oUtALb33lgrIy/P0P/AqbGpzNBMnx4SktP/ekR413tuY7Vo260qRvx6DsfjejS8Gs48r3u4gmqGJ7Dbwm4ofYRGD7LezgyHlNqK7o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=A/H7/y/Q; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="A/H7/y/Q" 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=7XH+G1Xb/vD8vf0GcakPf1WizXUz/rhT3tCc+q7JEcU=; b=A/H7/y/QFKs1vsAregCl8043HcAKJl5kPmodn8rpgGayQAguZU8orS16 xtpMDGFM8ut9lYsx9bkx1kzwklQlwQ0VFe2oZ0kjhlkms1+YpPPGJ/6rs 0qOmsMlCUhuMZqdNs1TQbLb6w9XNWZOXGGXGCjx2kY0ReFeTsfL/oXSkt h6MO7az8K7IfDqvN7Dk8XZ5jcLVGpseLLVAbAcPAiPsfLvDzV0lx068tm F/Cs14PhAbOAHLQq1ArFOuAUHFm6dMBdtaMEQtQ0bPCI6yLdX4sa1UqCZ rn5kC+vmO+peQYV36aZkyVGvVRIyPmksZ+1LvZbfaik+zRagwKXK+M8XT w==; X-CSE-ConnectionGUID: Ex+AJo10RFmkBlaBmkX6Lg== X-CSE-MsgGUID: b+dDmg+7Sx65wwt+FeS02g== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022573" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022573" 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is no evidence that the 'dev' member of struct stmpe_gpio is used, drop it. Signed-off-by: Andy Shevchenko --- 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: 825079 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C56EF21019D; Mon, 2 Sep 2024 13:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283927; cv=none; b=LS8ZV7X8ALhuKnKt5pRYMSsHkM/UO2Wknclvn520pVTWXfvUKu8upKpq0toL7cmRZuG0vgrsIA+boRIwMl8V5erXQeOgYkYbgl9pxhv+wJFzLPRLa1Iv0AVfHx0u+FuBHB/C3n9URmoMqCYniMLz5+15Wt3QIWStGtNjS6V22WA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283927; c=relaxed/simple; bh=sarn8u6DMiqscknv9atERVdrT9dOoz1FqQ1plDaPSJQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QDx+Z4OfSXv9ei70vS9wZImRW7+Jqes/nyBZkCifAowSOF/GVaf/AnEGUOOzYruLZhTI0+n4HEBpcLcdwKtOFzRRCmrZMW3EhDdeA/EaNrS8jkK5mg9SbKEm8r4+9Zkt5FHAxnr+0m6q457tgtJmue5/bRyXhRcfKUXCxOkpvdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DqRR+hu1; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DqRR+hu1" 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=sarn8u6DMiqscknv9atERVdrT9dOoz1FqQ1plDaPSJQ=; b=DqRR+hu1Ap9aYL7fGCnk+ZjSXUvWgLffUDpHwUFue83OvtGSXxeMwZhO twjzS9qe8wgBkF3RZnwB4gC/k3bM+nwktslbDvsdR4pCWQ++OE6OFwzes 4ymVv/zVcgr6PUHvRYDivNiV83kINWYZCACcE5+DR8abSrxxpDCisGmpY +n/jO8QmVg5XtawlUqsaF18G99kIl0BnbGaUsnRlVvtTQQVdXVYM1d9pP vT2e/IJjAu+a4s6JoMo8dqEQwGsKjqgWJLaxQ3YTSE93t+0Vjz7eKA8Kc 1UvILQshgzMVwUGfY3wgF87ykrea+E3UGizO9/fRDwsphYfBU7ySvnlLK Q==; X-CSE-ConnectionGUID: /Eu4W7FNQJ6Eo1WiESx9Lw== X-CSE-MsgGUID: qVSpoCK+SKKwCMs1DFwXDg== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022556" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022556" 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We have a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko --- 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: 825081 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93C8E20FAA8; Mon, 2 Sep 2024 13:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283924; cv=none; b=n53Vr4SCrTF8Z6obIgriq7clStRiqloTl0ZonD8DjagaSnhOj0vgw1H2a4jakkM1IJfjwIx6NPznyYXx/c/JYlm+vWxRcCESrDfEDwyrMHZndOoAwxc9l98a4/FM+4F6SE9Ri8nYw2mNjXzvBGTd0Tf2GCZlxGJS8NnZGeyykqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283924; c=relaxed/simple; bh=f+HzvJdgV9PfmdoJ0kwbhBMaeKBv9YJV29ZR+z0+n+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lnjOPoRb8MS1K3/dz8zbQtRC1IgVn5NDH2hqdqHm8U+Y/bux7JzDtsy1AsgDsO6gIWVBmozAKc2pQjMrbuOLsej1SVblQ2Mvf3b/p5cj1blhCvt5Ze6zgrtVdFNTOGs56vFoOEqkEbvWXa80KGjiepIcW6qDuJDW+Q53ZyYi3Io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=EuGjUvO1; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EuGjUvO1" 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: OQtHJ33hST+AlAUeithEhQ== X-CSE-MsgGUID: d11JgbAoTL+y5IzsCd5klg== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="35022566" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="35022566" 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko --- 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: 824722 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A6B220FAA9; Mon, 2 Sep 2024 13:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283924; cv=none; b=P58Uac5ubwm+C9zVF10KwJHaNIb5XMl6CC/ZxNuUUYkVzvojDiO5/wHKNRBIVqgoOxMRIH9NGaO9gifUSQzxqiUHq5wrAMsax/lD1+tr8MHIzdT4NCZg46aCCNY/cu+X2jfO1tdMY5kStMFBGsVYIouOiyE/tJ4m9ZjCf04aWgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725283924; c=relaxed/simple; bh=BSXDsgKfV65tn6E/T8L5w0XQjbUaQBnlDePaCFf+QeQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QgkipItYINxP3YZXZAt8lN1NOX4qugC+wN+Yan04ZGfqQjcEVZIBTm46bUTDM326hqFJN2nDbkI76nDpaOgK+M5vCaS3MGej58mqXpxZFqoTzogxKAXcY/C9xeabGfhE7yhFoNFVdHm9/tc6BiPPxEi+rfftcLrubFXO2B7G/zA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VGV0uQRe; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VGV0uQRe" 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=BSXDsgKfV65tn6E/T8L5w0XQjbUaQBnlDePaCFf+QeQ=; b=VGV0uQReLfvRflD4ZDENZNOMw2PzFKkTnu4Vnhm2mtFsiviD4cK4kYST 5ghDRml53jmaoIi8Ul8UCULSiuIWKhESZfz2/Qnp1FV0hAF5uhYtz6nvO 6zFM4KklFvUXkeXcCv3hFbvFM1p0wgvxzHKCaj6EtLihvxRgXuGS3swWG uUHVpSOIE7jBqkWvOfVqV6t9WIFUs87mtKFnq23jOLt7c4FHO/UfWuOHm V04xI0BrvsBsyosREbIGbIOB+pKv2MtqMuJjQtaeZcMUiMqGOWapUszuo otkR/9ipk0ihE71fTN+OawY2Jhc5IE6mR7gMtPB9vddqvC+PLW/L4OUWG g==; X-CSE-ConnectionGUID: NmBSXSTLSOuzArYaXUHrnw== X-CSE-MsgGUID: TZ6iuN2sRiGP/dR1mI0W2w== X-IronPort-AV: E=McAfee;i="6700,10204,11183"; a="41364551" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="41364551" 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sort the headers in alphabetic order in order to ease the maintenance for this part. Signed-off-by: Andy Shevchenko --- 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