Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp917576rdb; Sun, 18 Feb 2024 19:39:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuxH84akfTaceczByYGdAAuicPQ4upistogsMLF4om83WR1uWhM4g6p37GlfXYlAvuMJfpW6shZy5CI2xZseerdA5OKSlWrKTvnEYZpw== X-Google-Smtp-Source: AGHT+IGdSowjPe3sgntiid8VQudq+ehVI+P7ZKfmfyGsSRtG1EBnMBb7b5IrrGyCXI0EXY8VvIIr X-Received: by 2002:a05:6402:230e:b0:563:f854:1a58 with SMTP id l14-20020a056402230e00b00563f8541a58mr4829036eda.36.1708313974012; Sun, 18 Feb 2024 19:39:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708313973; cv=pass; d=google.com; s=arc-20160816; b=Ghpofy9cbZrM8vq7MGpi+NlaznbwR55Kj0rwsXFjbTGgE7S0ELboTEQsXyxOUn943d fvlbKxkr8LrDUTd//8H4udDJO/l4yiXfYOr2h5bT96Lvbwhs9KA50ObtXVXylBb51UZF BPaP/nMJMK7P608t/mxTXhGxggAtZNUj15F87dRUaIbPTQow5JAidWjckPWvtacMJB6l kQYD4vs4GsHMqqPbEC1n7iqFlAbJje+fdakcZV9ynFMVs4tM8GQwKDb3/T6KaY5aCXuT iKHCLouot3PxOEw0nOJZgnyCnx5oXAS0W9VLAdlU+rgdUTVJ5nrZ0h/2lUxmmrY+dpwN DBwQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70679-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f10-20020a0564021e8a00b005642c002cbfsi1597544edf.22.2024.02.18.19.39.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 19:39:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70679-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70679-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8C0F71F21B77 for ; Mon, 19 Feb 2024 03:39:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8CE1FBFA; Mon, 19 Feb 2024 03:39:00 +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 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 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Tested-by: Jarkko Nikula --- 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; -- 2.35.3