Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp175505rdb; Sun, 21 Jan 2024 23:51:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9eb3q/SdOnFd6sh1laWuJqcq9ZqLzslMGcSmYkmu2R4simcaGkmsd35czafnpUW1hry5S X-Received: by 2002:a05:6402:6c4:b0:55a:47a2:400d with SMTP id n4-20020a05640206c400b0055a47a2400dmr1088761edy.15.1705909908780; Sun, 21 Jan 2024 23:51:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705909908; cv=pass; d=google.com; s=arc-20160816; b=EcefLf7fdy4RKK3s6OnTy9zKjyha1tL3VtQpY99DZwJaT5fjxzbEfiztltPhebqUIQ N/4Nr7PSozV5sj3VfqyG15wKwtChc8AITIDSogPI3M4tXUQaYv3x3XK3a7YsWW0ISgH/ hCAImna+qiks/MMKbalwXKJwEdzh4kOG2GtEl4ldfFW6BNDhYOEf8sKhNmX04nL3OZTP 11X/Z8/ljU6HQ86coeLgWAX9xTSrjPYW9bxcucbJ0CYvt9w0xWThhJj74XSAq6UzLIuD R7XBKwIpM5b/bmuLBVDdjsHgChkCdXF05Ku/lCjWFlVLDzqtkAk6IOu/ANDGs/D9QWsU jPPg== 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=xMRbx4FQ9FPFNKS4y33cNbWCtnLHGscbGYm9cp/6uP4=; fh=y/RjPbXBoPouJTPaYxwEImQW6x8GRiLpamQFwed/jf0=; b=XRpwmHIvkIUhtQULcx2dhrdyzT1g5Elvm5o5bDbNGzWqQT7FdF+I++xArstV9WDKyX qD9JOKXVaM0teYeqq4e+4cY4VhBoNXvOOeGBh3uKo2F0fIBHB6icjekwnPCPTVsPSV24 6DnvYd4ZGKoza0m/VWOqwEPq4CqG6bO3takXiWIfxe57oAHCww5V38WEj3sdXROAkTZw 0rKikWtcgVoASyYLZXfVlzsuSDLBmnNrGu2LBijsHkLGTT5gKqfOghrKOoelezxCPPqo Q+ftXhNik9CbH6IWQ/H8zP07pAnNHcFgwOLSQnyCa3llSPirwrUwwUjZyQVMHf0no3Yt yG2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l3n6ufZI; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-32290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32290-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 ez13-20020a056402450d00b0055826cfa96fsi10679106edb.229.2024.01.21.23.51.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 23:51:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32290-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=l3n6ufZI; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-32290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32290-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 3D6C91F228F7 for ; Mon, 22 Jan 2024 03:03:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69E1923B0; Mon, 22 Jan 2024 03:02:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="l3n6ufZI" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 49867139B; Mon, 22 Jan 2024 03:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705892575; cv=none; b=SUxoWODzqaCm8StZOLHU7O4f1XKXExj7PzNuUAMOoOUxF/zFoclYY9CrrYCAelsnI8iw05EtUcaPMDcxl2awE4QtefIa5alhykLn//9TSITqxb9emzN4nlEOiR0Rye1feRGa6khnxS+klQ3ac3TJs0SSyKVvWxeZ/+EwMMVdlso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705892575; c=relaxed/simple; bh=xXgc14YVJHCCXERS4eQXjRO7DnYkSw+VIjrQ5G10S6o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B6aIGh8y3BRuE9qIQJottR8RuW4y2HfnHiy1qGthxEEI4xUpPOSZ8VY+G9DxmYF+AnmSz+BG5vsGOM1XYH0dwl2UifD22Q/+Tn14depvgmQZkpY3pIONA3uX8HKVvnNsCoDY7TtmeYUG8K5BzW6Dja6z50CLXJyMxlYHuFAL67o= 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=l3n6ufZI; arc=none smtp.client-ip=192.198.163.8 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=1705892575; x=1737428575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xXgc14YVJHCCXERS4eQXjRO7DnYkSw+VIjrQ5G10S6o=; b=l3n6ufZIdeWo6updMVGtFHJhY8qibh7qlaUyv+wmdOZmsLewhLIwh4AR fMjTXDm5b9gkNdq5zR8qQvG4hVFqnY69BO7x8vM/0PcyjZL9QvrhqcSD8 yBuvqZmodR0cybDY/iwFMR3auM1qs2tHI51CDIAfM6ChqaiqDL0nHEoSu NBIOjR62P4ALaeBpAW/oMAjosp+WcUutGUownejUVub0bnjjnSEQwgRQB d0QeRtyx+nvMKwco2FsTJLnLmfVGdIrbUms9YspfmWYETx492Eme0XxxE UhKKPeJzDx2iCl0Pga06WuCB1xfalJ6XXRjpUrwo57tNUbwSH5lHIo+Ch Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10960"; a="14607323" X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="14607323" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2024 19:02:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="1085521" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 21 Jan 2024 19:02:42 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 218854851; Mon, 22 Jan 2024 08:32:41 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 1C4E11600102; Mon, 22 Jan 2024 08:32:41 +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 v1 2/3] pwm: dwc: simplify error handling Date: Mon, 22 Jan 2024 08:32:37 +0530 Message-Id: <20240122030238.29437-3-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240122030238.29437-1-raag.jadav@intel.com> References: <20240122030238.29437-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. Signed-off-by: Raag Jadav --- drivers/pwm/pwm-dwc.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index fd64313cb38d..8f8035b047c1 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -68,24 +68,18 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) int 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)); base = pcim_iomap_table(pci)[0]; - if (!base) { - dev_err(dev, "Base address missing\n"); - return -ENOMEM; - } + if (!base) + return dev_err_probe(dev, -ENOMEM, "Base address missing\n"); info = (const struct dwc_pwm_info *)id->driver_data; ret = dwc_pwm_init(dev, info, base); -- 2.35.3