Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2435200rdb; Mon, 12 Feb 2024 05:03:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVpyD4fmPswNL9hsxPrfb2RwdXr9jDXQyUPATO3hhOX0xhVVHj7wx8EZqFRbiCi7e728i0jYi3IYUvciz5/G+Z4zONF+zEunbdERmfGdA== X-Google-Smtp-Source: AGHT+IHLbEISyYmsTw+dZdzDenFYe3O/xi5lT/idIxP9cBRq2Pi8ca4n5Ac0gnBqPpCPwXovslAk X-Received: by 2002:a17:903:2311:b0:1d9:cc00:526e with SMTP id d17-20020a170903231100b001d9cc00526emr12837805plh.13.1707743039719; Mon, 12 Feb 2024 05:03:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707743039; cv=pass; d=google.com; s=arc-20160816; b=nyx5LN62tUbgZivcIyBep5iMqu6cOQWLZCtrDa7KkB0HVmD11M++87/lOlPlKpwVVn Ey53r1TmhW2XYAxnVIBN0dJ7VVYGPhEZopunN11fN0YwDp9+wFBt2a+m+g251hOkVPfH GHk6bPEV0gGjIv1kopANBZFrC3SxG+9+3CgWavgx3J4E0P//63ojV+8yQHVKqq++LWCQ z6g8PVmbk1jlFKGWbcAN3KWK40rKsswtNB3M1u7pO36VMR0oIk4c0e+iuQwKbd21S6cH p48quEO7d6M0jPAq88irj5wIw+KIpJOu88Oitjj7zfKR3VPtVFnFNaQMh90IIZkBPLv3 iKVg== 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=4zQHsdqBwsaz/YcuwY9I8gx9QwvPkDydfmRrj1cuUtg=; fh=jJSpxX+UzPhCXKtvNjMvKLrhgDnNil8U0xn3CbguFh8=; b=E+hXAz2embL4HX5qGMxnQYvTEnuQTv0kDwGxswIzwvrFuOL9b6ovKUrH+7OtZgHpi4 GqqYaE9A+qG9AE/efMbeXd5zLnODk0uwSSBbWHF00IlkLbZf5g7uDK5jktFVlSP3gE1X 6eMZmwZY2/LXF4MfdA3Knk33FiA80LIudpXO6EC118uRe7VTsPoDCgRQQ3DoA59kCRmT GixRu9HNdy7EEN4vmc1pvQyBnAW0ya+FvgljJJjWoKFKMjr1GMfhaaqEJDqOqIBpF+OA uNfeZZLLm4GO75+kLl+HeMPjLBBD1IubfdjUy6Op+Gac2oPmvDQ22qQw+bHFs7AlGN/6 nn0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EexXGJ1S; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWstc3T9k5F2xTC6ES0DYMeCw+l7JbPK+F+batP83PjPSMj/M1ayfGFCDMyFQRRAKiLU//BXVZKbyAkTA+JRy6UsUCQPu85rKtMaYCKiA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j65-20020a638b44000000b005dc7c05e470si217992pge.590.2024.02.12.05.03.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 05:03:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61595-linux.lists.archive=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=EexXGJ1S; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61595-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B2D4C28676C for ; Mon, 12 Feb 2024 13:03:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8CBE3B780; Mon, 12 Feb 2024 13:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EexXGJ1S" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 8EF2F3A8EA; Mon, 12 Feb 2024 13:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707742979; cv=none; b=Tm4e15nhEG0XG3bpJWJPTWXw6fAdF0qyHFIV7g+VZlhvKOg4+gbEJPeCBfVZxXgJVTOxi4Vp2Ag3z+fwdUcXWmhsR4i4AG9CEX0WvIT+DVW6ojRHt4Drw2kZrQOPhrN+TEEY8Pcbkt5t3SL6hy7SAQuPZGUmXQ7/0l+QDzN37ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707742979; c=relaxed/simple; bh=iXxsS0W5mU5/Io+UvC+pcKSPNr+I3Jfk8yxtNeL8oyU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d6tP5MP+EvHrVXd3YLpldYy2NCT748XHRs5+A6WWBwno6MrUCQMKdHm0iAMyE/FgLz6/NqQhG2owLnyuAxtGnvkwg2x2JPnQ1HN2acRYlmacY3HlhUGzzxAeLmCZmFrB3qqMxDDBFfFzclzf+yy2C81vnwUB7NaRmCE61OGIw3U= 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=EexXGJ1S; arc=none smtp.client-ip=192.198.163.17 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=1707742977; x=1739278977; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iXxsS0W5mU5/Io+UvC+pcKSPNr+I3Jfk8yxtNeL8oyU=; b=EexXGJ1SN2RfRPT/soSOyQl4/3XnpM9bmbeB8HHec/k0LrHYY4IrG0Bp CLmqVAmdAH9f4zMlC4oV6ReZP1tczO/YFERRl0CmCnorrN8Ai9kUwc4Gg UhzTdpu/J38rkNXcr3wx97liIi7aDaMLn1XEJKHyHeL3qQZx4VnlD3STx qR/A/bdiBq7fzNK6MKbaglW3OM/U4WV9xvVzmYS/neizORPGBnjvryhlR r1mRUXfn6I25XERfUgq121e8HZNlfd8dera5EAJqkfgHRvCTXJ4hlXcrX t43gp26tGk0FUVxSd7+haPC0/8CVAph0YLpnRUErH3brFkcrKOxCHHU2n Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="1594839" X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="1594839" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 05:02:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="33378399" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa002.jf.intel.com with ESMTP; 12 Feb 2024 05:02:52 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 5A13B1CAFF; Mon, 12 Feb 2024 18:32:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 54EA81600104; Mon, 12 Feb 2024 18:32:49 +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 v3 4/5] pwm: dwc: simplify error handling Date: Mon, 12 Feb 2024 18:32:46 +0530 Message-Id: <20240212130247.9985-5-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212130247.9985-1-raag.jadav@intel.com> References: <20240212130247.9985-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 --- 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 6d922afcb20a..56fac8655c7b 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\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