Message ID | 20240208070529.28562-4-raag.jadav@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-57543-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp20973dyd; Thu, 8 Feb 2024 00:25:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IETogTk99hXmjA/jZNPWcLWDVYTUBDtiur+6q19ExYQ+1Q4Nbuy0Jaj/V8XzkhFj0I8I0oH X-Received: by 2002:a05:622a:ed1:b0:42c:47f0:a2f7 with SMTP id df17-20020a05622a0ed100b0042c47f0a2f7mr2422829qtb.44.1707380709558; Thu, 08 Feb 2024 00:25:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707380709; cv=pass; d=google.com; s=arc-20160816; b=MjOx4e2FOGcU4siSMF+j1hNmYBfpzfkU8WArkb4lugIUYNMgFmniN4JwpylirWsSuz 6ERMGbHpqPjrK3cN9Wm8tusH+QzyZZXb1AwFyqaIWMQ6ljbZlSPi5qrKadu1OF4mc1R4 lb3rWpVc5pKkJsl9pinMFfcnKFkOFLs3y3upIx71h0kgHGqLYPkUJMbgx0QcC/oCCGSz tSEdcPTNDfB+xkle6OJABagFGDFKzVfTkuM+TkjoLSDa+rMl5sXLLRuBxagUtYOipljc 0FAQm9Kw4PCjDwzagqjDJ3kN+L5w/LJmSxRvNN26lvmhaOHbMnw/uGhSwNdu0/7e7F9j LEWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eMOvZN+KUq0x2IXdScM+9KCNCtXwoy63AhJFwHmKLYE=; fh=UPCdsAqgZ78bDhmOBFNxwcdrTVI4tW47vHM+pwoGsGc=; b=ntMAJ1rnB0+gM5hSCv4WP705CWUJXGezi4F9K9MboNEv++2LSwMoR0q3dwfCTkNrX5 gYeQ0zsYoQjcSkr4AxfPNcAoXP4esixR6xGqATdgWcDwN1DCcJ1QnrtENDzcFMUaGB9H IdLmTcxGjDXVbh0m+0UiEc/GSHrVER+lxvECAeVAx8mIepVP36qc+U6gR2MJRplGZtFJ rO0w6dfT58BF/l0iMrORjWPlOMHNrHDbCLgnsBPCCOUWwLj/kZDdSAI2qS0YwmyGQX4h NsZ8tszENUGccepRHOLuZGIRqe31iwbQeMBTt5AlUM0SUK9Lg4K5u3HbqXArL8JSvvjw u/nA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AaetkHb0; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57543-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57543-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCU23MmuIvsBZBMopkUaN6zoZayARpuPFD3LVWLp27JvIvWAmvhuFVz8flv23RjJVS+uIXBirHBulJ9QWOR+pl4qdJMKjw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z1-20020ac87f81000000b0042c41d9e982si2629772qtj.660.2024.02.08.00.25.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 00:25:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57543-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AaetkHb0; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57543-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57543-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4A9B21C24685 for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 07:06:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EBF06A343; Thu, 8 Feb 2024 07:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AaetkHb0" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 3CB3169305; Thu, 8 Feb 2024 07:05:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707375947; cv=none; b=WuFoJu9sY5HspJXXTcyNQdePGOErgDIIvJPEHpZ4ATGlC7ZzWAgwP4KiMBypAPfoaTTndpBo0yktRkVubvmv2tkCLU35w2g15OuLW+6eQPsdz61ECbMbbGKb3pPq176aINoqJFXlEAUst8qABjLZhT+SKE0n6YsvxeSsrYkZpR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707375947; c=relaxed/simple; bh=Eq6BsNBRtBO2MQjyFEfYn5pR3BjbzZoHasX7K4WnV5Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fmCbjZgypClPpks43HcGMb+gySZgP6CXU13SntnM0/TXJgcnQfmgqPWrFwKsGd1MydduIzGgIFmch86P/g1bKv07TWu2fgUjrYv7VFeg8ZYuBgmbMI/2S/uHC6W54TmAwP87USxflcTmvptP9ymcnqubHKk7NQ072JU27Xafd+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AaetkHb0; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707375947; x=1738911947; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Eq6BsNBRtBO2MQjyFEfYn5pR3BjbzZoHasX7K4WnV5Q=; b=AaetkHb0tgPlx2qsaH5wLTWvy/kirZcxzOutRu0wbuYekGu17GAPlE+l USjL6Ad5VLOFdMJl0D8FmqUonUz2F/9sQGH5qF9bY/ReY2473/lZN23t5 Y8n1d6fNtWFe4+tR1Z+aXIS+nMnFVLfFWB2xIp0KOdg6CByj9vlBWq+CG +rQr7BXhsWd08btcgc664Wz5pm+6OG/ZJhx5E0PHCPW0exBZzBMTXd/yF 0hqbxgyu7RtK2lsh0w8nprwFXZef3cizdHKkgjBz5i/9wgB2/xwiuNAY0 oPQG/1Wq1G/OjduIFbvXm/dG+WeX8OhWVbxUYtv3FQO3uWjXtyw7dEswB w==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="12525868" X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="12525868" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2024 23:05:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="1573962" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by fmviesa007.fm.intel.com with ESMTP; 07 Feb 2024 23:05:36 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 523D314354; Thu, 8 Feb 2024 12:35:35 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 5220E1600100; Thu, 8 Feb 2024 12:35:35 +0530 (IST) From: Raag Jadav <raag.jadav@intel.com> To: u.kleine-koenig@pengutronix.de, jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, lakshmi.sowjanya.d@intel.com Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Raag Jadav <raag.jadav@intel.com> Subject: [PATCH v2 3/5] pwm: dwc: simplify error handling Date: Thu, 8 Feb 2024 12:35:27 +0530 Message-Id: <20240208070529.28562-4-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240208070529.28562-1-raag.jadav@intel.com> References: <20240208070529.28562-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790318434964470653 X-GMAIL-MSGID: 1790318434964470653 |
Series | DesignWare PWM improvements | |
Commit Message
Raag Jadav
Feb. 8, 2024, 7:05 a.m. UTC
Simplify error handling in ->probe() function using dev_err_probe() helper.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/pwm/pwm-dwc.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Comments
On Thu, Feb 08, 2024 at 12:35:27PM +0530, Raag Jadav wrote: > Simplify error handling in ->probe() function using dev_err_probe() helper. .. > + return dev_err_probe(dev, ret, "Failed to enable device (%pe)\n", ERR_PTR(ret)); Have you checked the output? Note, it will duplicate error codes which we don't want. .. > + return dev_err_probe(dev, ret, "Failed to iomap PCI BAR (%pe)\n", ERR_PTR(ret)); Ditto.
On Thu, Feb 08, 2024 at 07:22:13PM +0200, Andy Shevchenko wrote: > On Thu, Feb 08, 2024 at 12:35:27PM +0530, Raag Jadav wrote: > > Simplify error handling in ->probe() function using dev_err_probe() helper. > > ... > > > + return dev_err_probe(dev, ret, "Failed to enable device (%pe)\n", ERR_PTR(ret)); > > Have you checked the output? > Note, it will duplicate error codes which we don't want. True. Does it make sense to remove it? Raag
On Fri, Feb 09, 2024 at 10:33:01PM +0200, Raag Jadav wrote: > On Thu, Feb 08, 2024 at 07:22:13PM +0200, Andy Shevchenko wrote: > > On Thu, Feb 08, 2024 at 12:35:27PM +0530, Raag Jadav wrote: .. > > > + return dev_err_probe(dev, ret, "Failed to enable device (%pe)\n", ERR_PTR(ret)); > > > > Have you checked the output? > > Note, it will duplicate error codes which we don't want. > > True. Does it make sense to remove it? "...which we don't want." had been stated above :-)
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index 47d76f5367fe..e1e3c62ecc56 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -51,18 +51,14 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) int i, ret; ret = pcim_enable_device(pci); - if (ret) { - dev_err(dev, "Failed to enable device (%pe)\n", ERR_PTR(ret)); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to enable device (%pe)\n", ERR_PTR(ret)); pci_set_master(pci); ret = pcim_iomap_regions(pci, BIT(0), pci_name(pci)); - if (ret) { - dev_err(dev, "Failed to iomap PCI BAR (%pe)\n", ERR_PTR(ret)); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to iomap PCI BAR (%pe)\n", ERR_PTR(ret)); info = (const struct dwc_pwm_info *)id->driver_data;