Message ID | 20240219033835.11369-5-raag.jadav@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-70679-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1114192dyc; Sun, 18 Feb 2024 22:44:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV/S/p4QYCeq5/5KqA9vj38vd2zXQLpcyFi5xKMxfcJfCapuCgAoM5rC44VrX+9IWo+FvYmCRWpXDRvnrONTduDb9am0A== X-Google-Smtp-Source: AGHT+IG4OHSkey9TJxv5zCTg1SGVIoKWcXhvVhBVJ8B2L7+1c9BWBSPPnrzR4yUl9bXozW1GAd4L X-Received: by 2002:a17:90a:bb8b:b0:299:54bb:5cac with SMTP id v11-20020a17090abb8b00b0029954bb5cacmr4077860pjr.11.1708325097385; Sun, 18 Feb 2024 22:44:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708325097; cv=pass; d=google.com; s=arc-20160816; b=Bu0Hy70SFrSVu7C4aoOovPg230i2xfhWZ/Rx5BamrLZmIII1BZoJqk7UYAbb2S/5IB K1OlEVxJmgQrsJ24txQF+hhMi98y5cvtc6JLyXkungYVX6IuRbkP/T2Hnyd2K58/96Py bDgwPSmXBLdvdQDx4siNU6GcsC3Gb81/C6ky6ru/63HuQ9uh4ramJoE+q53fCDHKLM7m 3Gu/A61gTuuplb4KywabTczuFqfIAl0GQWL7QNXGvqVW81/On44wPza48hBhIxBy0Ws5 hO8Xqnuimc8tKAg9A6lh/cJUutrad17FF7jaa/hq7thDhJVQrMFA/hmGgreBZSkIQQ2o bGtA== 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=sj1RslH3nTcJN2lIF4nen+uL5UwvvxY01aUsU9TTwJ4=; fh=y/RjPbXBoPouJTPaYxwEImQW6x8GRiLpamQFwed/jf0=; b=vla9njdsolVCtBMj98WQ4CvNp2Dgi0kzkcQRKYq8gt7E82v0gMphJAN+0CYwIyNnRE zeJnpgkY0+pNKqRVoqP2dgy3j6ApA/KmWERngmoUQHT7XVr/4EAL7ubqW/fKqckufzgQ P9GLTrfwyGaNCMuzWrDAdBww4O0ZuHOtg9Hq9dvwBBrY6YGNZ9/fFlo07NXLVTXc16D7 gUnhv4Fg5UY13IQYz0tpzYWYmeGVBfyb1at6BPdYcCvZrO3b20FFbd+gUlD1CQW6aYBc 1a2muBIkv2hxcCUElPk29tb/ii+RVtzO9xG+BBjyWfX0zAvYOMUTxFmMXXfHjWyA1g/g aX1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TNi0CWEk; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-70679-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70679-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 4-20020a17090a098400b00298e649da8csi4062775pjo.135.2024.02.18.22.44.57 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 22:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70679-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TNi0CWEk; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-70679-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70679-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CDB6280DBD for <ouuuleilei@gmail.com>; Mon, 19 Feb 2024 03:39:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B647D1B811; Mon, 19 Feb 2024 03:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TNi0CWEk" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 B8DE5567A; Mon, 19 Feb 2024 03:38:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708313940; cv=none; b=se9K3nmXuTr3rlmSNrwz6YgLKNEzSpvwPGjzDL25fX0HqVEkFxx9meINx9L9MQIHJLsjOAyz2/f74gqwtGbwHse7/imLKXkjFEqlNJtVGFIlg2YUHVJRo9Rz866ZM8pCmGradVBZfDVgOz/37TyavuNgUTfjs2m2Ze1DoQkoqKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708313940; c=relaxed/simple; bh=KW3Rg0hKJSlekLEkpQDUS0ofXFzF55PYH45WySuASc8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=t/XONEwqP9oQm6qkSxAuS2cdwpY1ihLjkHSGWz/kZYujjTeqz7CRVetPGw7XrJvakzF0xPulA1fxpzVIKtH297pzOL3NL9JrpCLYxVnoOy9wUbDDC2pOiuWR0NFXYzffdgV0x9/WTiVrBNNKgn4H4tcWy9krs4CcvzME7CYLAkI= 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=TNi0CWEk; arc=none smtp.client-ip=198.175.65.9 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=1708313939; x=1739849939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KW3Rg0hKJSlekLEkpQDUS0ofXFzF55PYH45WySuASc8=; b=TNi0CWEk6xm+S+41ucxbmeNGFts0WZK62fFQ6RrlppT2/xV4saVm9LPP BTm+By3Iv0qMqy2R2Uti99j7pJ3x1mWAmJA2IdmdodeklGlmiU/GxWE/0 PeF5Gpe9xSMCEisD9yN3CtENJrFLEfa1/K1OZcZzkHKERdKh5tQlBbcZi Zwnbzh/fb28GC3k4g9dICI+yP68AR9icc92vvsgyl7pIstzFYuP/dG4S1 DjGLzZWy7jkJRn1ZX53zrpX3oosywpG864yr76sqrd8i47E9UFoO3iIRx EEwmnMfyWQgyHiZpso++oV38SnetccTV/1qiRo10Fso8+Naj7hOoIM8VX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10988"; a="24838178" X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="24838178" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2024 19:38:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="4281850" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by fmviesa007.fm.intel.com with ESMTP; 18 Feb 2024 19:38:47 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id C89BF72DF7; Mon, 19 Feb 2024 09:08:45 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id C387A1600104; Mon, 19 Feb 2024 09:08:45 +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 v4 4/4] pwm: dwc: simplify error handling Date: Mon, 19 Feb 2024 09:08:35 +0530 Message-Id: <20240219033835.11369-5-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240219033835.11369-1-raag.jadav@intel.com> References: <20240219033835.11369-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: 1791308697386745824 X-GMAIL-MSGID: 1791308697386745824 |
Series |
DesignWare PWM improvements
|
|
Commit Message
Raag Jadav
Feb. 19, 2024, 3:38 a.m. UTC
Simplify error handling in ->probe() function using dev_err_probe() helper and while at it, drop error codes from the message to prevent duplication. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> --- drivers/pwm/pwm-dwc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index de95352081fa..676eaf8d7a53 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -53,18 +53,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\n"); 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\n"); info = (const struct dwc_pwm_info *)id->driver_data;