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);