From patchwork Thu Feb 8 07:05:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 198199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp20998dyd; Thu, 8 Feb 2024 00:25:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXgiledE4PbQGUsbLfZSeROdYls8e5SfebadBwfGW2GmSjs1dpwI+v5bwL5RBjNH5pyONBiVNK7dgmRieipIQ4Ncdl2xA== X-Google-Smtp-Source: AGHT+IFCdxqlcTTdk93S95YZzKAj3+ZS9NviCFBPDBVd6uTTvrTIZMfItEvHajFVYXvyP9Sz34m9 X-Received: by 2002:a0c:dc14:0:b0:68c:9023:6319 with SMTP id s20-20020a0cdc14000000b0068c90236319mr7518164qvk.22.1707380714832; Thu, 08 Feb 2024 00:25:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707380714; cv=pass; d=google.com; s=arc-20160816; b=Mm4tZ/ndBqwd3/aEz8qbbpHrz5JupKq0KDEL/vBn6RRuE4xbKJT51F3z5Yxq9qUU8a 7fpLiUJyNPbGf+AEiA0sZToZ4GVKuUFgpjZ0i/5NxQDsVkUKPgjUNm+rRKg2P3vOk9wz j2KHqU1EEMFmFsc0xqK5lHDmBH3ZJP8NkhdZqDxPK68NstWt14yyl5YTBqsmohNwMyaf GLeUF6nkMSkkVcezG/JmqSCEzVHe2boEQ8eYFQ+nxz5gQpGzic8Fx4tel3YVY7RJ7I1P KTGP5zPwd1pXS4zs4GZFO/U6WUi2/e6nnQVm+Ctn62QcC1fa8UQlw8z9jsuTpPvlhX7y b38A== 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=M64jCRUSpSUkDmHuB3hCKu28JM276TK0qEswvufKzOI=; fh=jge5rShHg8YqOhb3XT+KSLl5pRl1eGG0uiBeIk0osQE=; b=KtoGlsIbeMeqA0mU3PyjPMtHkHykEx7BTMMgvdc57j1hV12Z7uUj742gXGdPzTcgM7 d9BlLqsqjRLaHzsMmbKqnyNKdZ246mL7D5QSHgrAFMFjMHuXvu7oG4gLJ12H1XqQZ/na gDSUiDEQ1y1vRu1MyNEMtb9FHAirRHyjy+I01aO0XkIzolofWmtOv6LlFU+PnpM/jGSF +poDQpGXR8mgjIqTZd7qerwiUdns0k5hnKcyzo55BwJP6jLDfyXpDsEgT5uPy/ok6Pjy Qx6N31fHYTzSsjOPz+kUN5aNKPrwYeb0CjjPOE1qpcgKEtSQx1gFLgrqv1L7kOClNlH2 t3hQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SxjZ4aN+; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57545-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57545-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXt1MoUfybq9o1Qin4Jz2YJWYVUXVGuuO3vg3LOAgdfHC79lSbYigHwayF1/oe+CMcwrHWg8bc+3PH71KtOtd8P2aKC5Q== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u2-20020ad45aa2000000b0068cb7c033d6si3017131qvg.24.2024.02.08.00.25.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 00:25:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57545-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SxjZ4aN+; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57545-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57545-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 AC13B1C24DA7 for ; Thu, 8 Feb 2024 07:07:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C170D6A8B4; Thu, 8 Feb 2024 07:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SxjZ4aN+" 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 BA04869964; Thu, 8 Feb 2024 07:05:47 +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=1707375949; cv=none; b=lthHGhk275qum1ymrjGBZT7wwcAuF8C9dIkJ3Vsh8WLcBULBGpxVfJr64ZUFZUgtSSa5K9PhEoN175icvKFxUy+GB9H2j1kPN9nVYFJB/Hvpkkk43SKaFQgFV8sKuyoZlVhcxmT5n0Y5Uf79+IOSBtcyh+AA2LP+9bC0+TCl3uM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707375949; c=relaxed/simple; bh=SLcziUGV3wn1pdz6JlsUPS3h94i8kBpVxgL2aMtWd88=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mxEEiXObbavEq7uL05ltwupftHbV5NPa+RzjhKhZjQ6z/Mq7SByn59GU+zVYyOSOmRWGfcKQ1h/QLTvI24j33Lx8YVk+ShiVPVe2k35OtSKqYwN/D/e7XxRKDv6VwhScOHs+ynZ+J7osIZwuppQ2jwsXG0Rleq9Op0gsVoTACkM= 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=SxjZ4aN+; 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=1707375948; x=1738911948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SLcziUGV3wn1pdz6JlsUPS3h94i8kBpVxgL2aMtWd88=; b=SxjZ4aN+vAVuTrJuTlArZV7DBQaEJwoCymTNU/jQQGya7w9z3UPVnd8I 6A2m1QgLh9NsTxJEAM3quEh0HNCELEG8zCYvZR2hRinVi1Bs00VMKul5s OSzPRkd0OZQywGyZITcF/RDl01PZbpDed7sOrWJJ/1p/NJqK0VJqy5e5g X27ySGCbXyWZPZCH6s765QIdOmKty4fdZksnCIHfkIO/zQsB6UWxQDJhR 1lR/lx0ZaPqG+E7EloRPmdXahuSjkDkMVI0HbbfEyMZ9BawjPRBpXrGxT jRKjJDZOiTn4oW3OZszbPGnUhaOJ8b5XfDPJfTcgc70PVoTaGI7yA6E1L g==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="12525872" X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="12525872" 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="1573966" 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 4E9CB14320; Thu, 8 Feb 2024 12:35:35 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 4C6131600101; Thu, 8 Feb 2024 12:35:35 +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 v2 1/5] pwm: dwc: drop redundant error check Date: Thu, 8 Feb 2024 12:35:25 +0530 Message-Id: <20240208070529.28562-2-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790316054277920142 X-GMAIL-MSGID: 1790318440095027955 pcim_iomap_table() fails only if pcim_iomap_regions() fails. No need to check for failure if the latter is already successful. Suggested-by: Andy Shevchenko Signed-off-by: Raag Jadav --- drivers/pwm/pwm-dwc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index 4929354f8cd9..596a0bb35c40 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -50,10 +50,6 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) } dwc->base = pcim_iomap_table(pci)[0]; - if (!dwc->base) { - dev_err(dev, "Base address missing\n"); - return -ENOMEM; - } ret = devm_pwmchip_add(dev, &dwc->chip); if (ret) From patchwork Thu Feb 8 07:05:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 198259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp52641dyd; Thu, 8 Feb 2024 01:45:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVSMo8ZLnSdeOr8g7nGzNBj+ajxahsAmf4+yFHLkCNpnuyZuhVMCns43ffZdir3PquKE11nRV7jAaoPIhVlqtuRhYfRxA== X-Google-Smtp-Source: AGHT+IHTCeDDEQgWO3y8T2HoEI6LAmKJ9lSRK5lvRRlS8tEkth4ftowv0Cov4enpnjx4RBO7HXPH X-Received: by 2002:a9d:644f:0:b0:6e0:d6e9:debe with SMTP id m15-20020a9d644f000000b006e0d6e9debemr7289150otl.32.1707385515122; Thu, 08 Feb 2024 01:45:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707385515; cv=pass; d=google.com; s=arc-20160816; b=Y3UZdVmFN/pL7X3+NnonVgKfgz0pJGOdI9Uq+y8zB/XOG0jR/sLwtnI6oKLWFF7Eox aLdv59aCI9XFJ6TC58bZsiM6+x0QHLMTPFTtfuMYbZLcUjviQ2cP6ae/T9SMVSJw1Ap9 KA02P0mcQ+3g4VoE7PwLYxvSvFNyIZ4Dhm9K2cb9NTsAYhBIWP5LufW+6dz9WLRX8KUf C/AIEHx9OOssZdnm8iKEk3X1pQ4zRbxSODicPHRGeQZBIJVWLo/M8EHKXFN2vEj8YmHt vQF0iNf8bh+SyGFCgd8OUdYcDskYe6vl1AswWWNajMO6nrNroUcip84804sTYDTa/lIR zRUg== 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=LsVp0PvwUnRyKtOz4XX9YfpRT50ZWJU7f82phG3Lfo4=; fh=xeeeHQ4OS+MK7VFnfHspoNqBgpYdSlAdcaNaw2l7iWw=; b=Jjoa2Poet5MGDEhgAaBAAD59q6On6a87JB8IZL/X6mMLh8N0jdOnP5S6EP1hSjQig6 o7wP9V3ZRry51Sswf0fKOnIcsogsSJIihrG34HN8LglGIjdgSU4rkOvTEAE/SmG1avxq XVwVIzx+wKnyojzyu/iydjtvK1p+eJwKX8uaakSSSTQz++J3GABwLt5N3vTEXsZxbTEC wr2VUU+LWfv8VDI5o4yl3L2/J0skjQAsfIIX9Thp9kzPtl429R2dzeJQinC2O8DheVu3 ZjXb6zRIBhPm3NV+K7hN9ZnM/VkiAJYTqjgRSVDWCfolgvz1kZmfAhQLzgmOv9KlEVj/ 3XDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gf7R9CJR; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57544-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57544-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWZNDiIg9p5nmqJPbA7VpTudd80UXm+ZA7XD0RGBR87InnKJ/SRGDph46iE8Ai/r9X5zXQdn1SWb0ySNHKVWWTiylQwfg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b21-20020a639315000000b005db76738ae1si3632935pge.229.2024.02.08.01.45.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:45:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57544-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gf7R9CJR; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57544-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57544-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C8775B234AB for ; Thu, 8 Feb 2024 07:07:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7502B6A8AB; Thu, 8 Feb 2024 07:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Gf7R9CJR" 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 29DD769318; Thu, 8 Feb 2024 07:05:47 +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=1707375948; cv=none; b=ZbdE6xegL0/kqMvxU9na+iejnQnAs9/G+w5kO/nowd6T0opvjsKngjHrnNCozwc7dTvQTH7ky+qCNB2tRhhitgQ0lrMYH3c1xcl6BF1BpJwvlTk5u+0FEGvQqb4Sxequwsui/AzA1EB0wQUGRJ1QdEOG92nSPlqRNAMec2XigDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707375948; c=relaxed/simple; bh=OhT4XZj8t2RtDk3NO3j6nx+lfeIyy2pDTu1PML96cWQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ewZn45T+/PSRMYhHCmZapqM2opwV8XSQ45jJdGaBOoaowBTH2RxGaYsOHVV2yJKjGmLZ1di91wCgFLD0NDUNNwDLf7rKNVSYsqgf5lm53XfAKMZy3/eHvMXL8ppabtspGJNatLs0GW2I0m1YGrs1CBLvWD59+wjOhnj7VdL+hhU= 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=Gf7R9CJR; 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=OhT4XZj8t2RtDk3NO3j6nx+lfeIyy2pDTu1PML96cWQ=; b=Gf7R9CJRnqdUyu6opmDZP4fsPYcmWUBSz+qhtEJ6ZQeLHexFAdWntZN9 VNp7/qU31gm0GaolbqDNBKq4NgJshKuxsB+5PJrw1xcqxJSD/RkE9/Qum t/zylTczLvxtnrRPI+ywoOowirrxtdLu73XH0eRn7BHjZiq/UzjCKflXt FsnAMpC2aPZL/HxnN6v6+5Qovazu2K/+LX3hLckvTQitG/GHIu27f7Bz8 g99mt6+x+CKjzdQHeue21KmD3QEBfbSCaiES1MLSMIn/kMYGrn489c9aX zUJPP3Rj3rZ1RRksbaSg5scYX6dEL99ZqsJmo2zb9Vf0lLzg8khhw8DE7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="12525870" X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="12525870" 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="1573964" 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 513EB14353; Thu, 8 Feb 2024 12:35:35 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 4F5401600102; Thu, 8 Feb 2024 12:35:35 +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 v2 2/5] pwm: dwc: Add 16 channel support for Intel Elkhart Lake Date: Thu, 8 Feb 2024 12:35:26 +0530 Message-Id: <20240208070529.28562-3-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790323473851665146 X-GMAIL-MSGID: 1790323473851665146 Intel Elkhart Lake PSE includes two instances of PWM as a single PCI function with 8 channels each. Add support for the remaining channels. Signed-off-by: Raag Jadav Tested-by: Lakshmi Sowjanya D --- drivers/pwm/pwm-dwc.c | 33 +++++++++++++++++++++++++-------- drivers/pwm/pwm-dwc.h | 5 +++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index 596a0bb35c40..47d76f5367fe 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -25,16 +25,31 @@ #include "pwm-dwc.h" -static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) +/* Elkhart Lake */ +static const struct dwc_pwm_info ehl_pwm_info = { + .nr = 2, + .size = 0x1000, +}; + +static int dwc_pwm_init_one(struct device *dev, void __iomem *base, unsigned int offset) { - struct device *dev = &pci->dev; struct dwc_pwm *dwc; - int ret; dwc = dwc_pwm_alloc(dev); if (!dwc) return -ENOMEM; + dwc->base = base + offset; + + return devm_pwmchip_add(dev, &dwc->chip); +} + +static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) +{ + const struct dwc_pwm_info *info; + struct device *dev = &pci->dev; + int i, ret; + ret = pcim_enable_device(pci); if (ret) { dev_err(dev, "Failed to enable device (%pe)\n", ERR_PTR(ret)); @@ -49,11 +64,13 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) return ret; } - dwc->base = pcim_iomap_table(pci)[0]; + info = (const struct dwc_pwm_info *)id->driver_data; - ret = devm_pwmchip_add(dev, &dwc->chip); - if (ret) - return ret; + for (i = 0; i < info->nr; i++) { + ret = dwc_pwm_init_one(dev, pcim_iomap_table(pci)[0], i * info->size); + if (ret) + return ret; + } pm_runtime_put(dev); pm_runtime_allow(dev); @@ -105,7 +122,7 @@ static int dwc_pwm_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(dwc_pwm_pm_ops, dwc_pwm_suspend, dwc_pwm_resume); static const struct pci_device_id dwc_pwm_id_table[] = { - { PCI_VDEVICE(INTEL, 0x4bb7) }, /* Elkhart Lake */ + { PCI_VDEVICE(INTEL, 0x4bb7), (kernel_ulong_t)&ehl_pwm_info }, { } /* Terminating Entry */ }; MODULE_DEVICE_TABLE(pci, dwc_pwm_id_table); diff --git a/drivers/pwm/pwm-dwc.h b/drivers/pwm/pwm-dwc.h index 64795247c54c..c9bbfc77b568 100644 --- a/drivers/pwm/pwm-dwc.h +++ b/drivers/pwm/pwm-dwc.h @@ -33,6 +33,11 @@ MODULE_IMPORT_NS(dwc_pwm); #define DWC_TIM_CTRL_INT_MASK BIT(2) #define DWC_TIM_CTRL_PWM BIT(3) +struct dwc_pwm_info { + unsigned int nr; + unsigned int size; +}; + struct dwc_pwm_ctx { u32 cnt; u32 cnt2; From patchwork Thu Feb 8 07:05:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 198198 Return-Path: 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 (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 ; 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 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 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790318434964470653 X-GMAIL-MSGID: 1790318434964470653 Simplify error handling in ->probe() function using dev_err_probe() helper. 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 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; From patchwork Thu Feb 8 07:05:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 198309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp86373dyd; Thu, 8 Feb 2024 03:04:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXatXSn+Ohjc3GtWH+Jzxg+ps/mtMu/iaBwIu91QDF/thq7xabegJ5exkjxRfuxx99mGcKKh8qA23pFD+8dhDtDBcU3Tg== X-Google-Smtp-Source: AGHT+IGEFQ5uzmm/F+oQ2NZWTt24R0F0PmWd9bIbioaFxfoJMQg+6/kWdXk2wW2BwmTUAB8p0y7/ X-Received: by 2002:a05:6a00:b82:b0:6e0:51cf:8a01 with SMTP id g2-20020a056a000b8200b006e051cf8a01mr6872747pfj.6.1707390296837; Thu, 08 Feb 2024 03:04:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707390296; cv=pass; d=google.com; s=arc-20160816; b=AUqXi1BgQnzAi2javJpaYnHF3BraIkZ6pjRkxbMzldzP2ZK0H83NomDNdRlpOPg9sj wY+IDUTSQCzwVA37Mq7vlpsd5ccIzYiU2wMkl0oWpwqtMbmCEamv6/C3q+G1Il7tSL1q ePSTUy3Pm6Rxmpjv/jftZSYSngbq+4Em7MdMFBJgf+22HjnWem+f8bV24Cw1V9cplZDO ohwq1sEFfcU0+3hrvaUx3bRlTy2YfZMn2gK1y9wii+tnlCDO2hMuw0NcnkcEqndRbxCw yZTtSrIij4wpMOrEbDAmBjzWoX8mJh7On1pO/iyiwlaB9muMQrrpluNKuz0k2UZSeXsv Ymgw== 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=QBdg0jyPgqpA+sj8b91Q2vZmDgm9Ecz6biDqqriyIvg=; fh=8WErZ0JCQPEcTGBOkLrO/Vk1wyr7cL5B0QttK0DBoEI=; b=eIXDwHjc4TrwtKSxJ7/NLx/snWU8U1S9D6qiX52x9k07BDYHTF5p5IBPGFwI/w8Pwc 02y52Pin9Mxxv1RM4jJ6PY2fpmSRmawPaGr6CdJozqIZlTzWeLfcan/vtbNwZLvZ1p14 vZo/Hkdbk+HNt7zFcgnV6r+1eEwdn37tgF/R4JLSDFnzsmaRBwDjPgnx29YXv5Mc0Lyx KUKSDXvfzPP/s9o1AF02958NTDWbgbIuwjhYzoRpAo0sfGNv0qNwzTmd4hP7iForgsUN petnkyFCAXc3Ny2Gd4jnkqgtW1Vsn8raTmeqDQ6HfU6U3xkmVeCylJbqYlXkcrSdmsSO 3lUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SjCddDfX; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57541-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57541-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWlk1pKi8q70HpPCLZNvn/PyfFWI4AGLtYZt6GyAlhE9GXikljhuTuaIrWSlzU/v1Rim1KMoS+22XOV/R4XR8nBqeApxg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d27-20020a631d5b000000b005dc35fee7d5si1629916pgm.525.2024.02.08.03.04.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:04:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57541-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=SjCddDfX; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57541-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57541-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 CE26E285D32 for ; Thu, 8 Feb 2024 07:06:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0EBF69E15; Thu, 8 Feb 2024 07:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SjCddDfX" 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 F393D692F6; Thu, 8 Feb 2024 07:05:43 +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=1707375945; cv=none; b=pzIAWHQajeG4wXAb4qtG8PimNbgf287Y8sjMhSIwSM3gzUwu2kbIFVRjzgFgS0D0ITNCR1HPJMI3GbuZsAU7FEEBUmlD/e5JkY9pB0V4qYvaXTjfEQTvUxzkgfup7L5H5RMgxiMbVZdRmdlIcvYqNkzwsP8KvvejPqLHqyhx1EY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707375945; c=relaxed/simple; bh=UklEqiVSLKZ/zAaY5ylL2DI/IQCa0RUwP7vNXq+RS9Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kr/D+BHNC+knueXjsuFofNqwtesqZ2VOIInnX5A958avMcnoLcwmyvmvF7ogTWYO76zHYiW3lTfwCIxRjJsS8bRka2vdppUz95NaLRYhYZ/0yheR4QZDbJxz3K6vZIlRTvlnMre+ZG/1lmnVb5E5974F2+rJFFoDDwUYmj1N94M= 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=SjCddDfX; 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=1707375944; x=1738911944; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UklEqiVSLKZ/zAaY5ylL2DI/IQCa0RUwP7vNXq+RS9Q=; b=SjCddDfXk6nOAtNuN85vo3n+MoUCbgARG6x0GgtQBigzSlPwT6jDvewz UDeiIz2paRKpYGjXDaSzKUbmbO9OCsnabT15P8D3CA58Q9ZMMqQGgyCOO 8CWFNubX7DHIq/Wj2k1qIebddJrT42f+ZHW0mVwZrbsLVbjashVMOYsdb ipfltEGAtre4Zg6Nez3Z7a6612Gh4XejQaLkwygwqDGKVoRdOmh1ndL3n GWTjh9jQTkbvPWAuUPriHha8Xm98qwQywZa0zrJlPLwpA3wxnghP4Q3nj XZ2SrH4tjMaGVO70r5OCU2HYALqNtJpg6gX9Ac6dGXpWWl6SowJ69CC4t Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="12525864" X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="12525864" 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:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="1573958" 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 5557C1862E; Thu, 8 Feb 2024 12:35:35 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 54E051600100; Thu, 8 Feb 2024 12:35:35 +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 v2 4/5] pwm: dwc: access driver_data using dev_get_drvdata() Date: Thu, 8 Feb 2024 12:35:28 +0530 Message-Id: <20240208070529.28562-5-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790328487772454492 X-GMAIL-MSGID: 1790328487772454492 Now that we're setting driver_data using dev_set_drvdata(), we can use dev_get_drvdata() for accessing it. Signed-off-by: Raag Jadav --- drivers/pwm/pwm-dwc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index e1e3c62ecc56..cc5bba977f47 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -82,8 +82,7 @@ static void dwc_pwm_remove(struct pci_dev *pci) static int dwc_pwm_suspend(struct device *dev) { - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); - struct dwc_pwm *dwc = pci_get_drvdata(pdev); + struct dwc_pwm *dwc = dev_get_drvdata(dev); int i; for (i = 0; i < DWC_TIMERS_TOTAL; i++) { @@ -102,8 +101,7 @@ static int dwc_pwm_suspend(struct device *dev) static int dwc_pwm_resume(struct device *dev) { - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); - struct dwc_pwm *dwc = pci_get_drvdata(pdev); + struct dwc_pwm *dwc = dev_get_drvdata(dev); int i; for (i = 0; i < DWC_TIMERS_TOTAL; i++) { From patchwork Thu Feb 8 07:05:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 198315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp90318dyd; Thu, 8 Feb 2024 03:12:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVzUz9W4LsD22Cg9r5TKSqjmZSb7YWOStAuy8iAVPplRsvARqjs/8RXHwHNgrQt8cROu04 X-Received: by 2002:aa7:d047:0:b0:560:c6a8:e7dc with SMTP id n7-20020aa7d047000000b00560c6a8e7dcmr4177782edo.1.1707390769087; Thu, 08 Feb 2024 03:12:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707390769; cv=pass; d=google.com; s=arc-20160816; b=otTPxyrIA6ilRpioJEkbyvQdGjl1C4rbKRmO3/BCBBQ/HD0jx9b9JHBvM9v4+k6k/c QA6qQryVSSKR60Sf1P72xCxJ9TZGxPx+SemocKx4nvt35SL7jXdgxnWndmxjxpTKkn9i RZ0nESahP2ojivEGZxZpI9RWSA49I5pc7kMo857NJaoQnXZN+xWjly7648M5XFADxlZg 9kCn/abRaT1ObJBHZ0j9T4EjlWDE9+jCT0wRZyGu+nUPmlxBpSbs7n+aZ5i78tVtIhd7 kcW3pQaZ1TL0GROk7GUghEpMPg50ZDLy1WtHVwP9utBAliayOvqe0v8SbWISV/pLW7C9 3Yqg== 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=icCp6ZorlyeeeesJeFwacOzLWo4PHFsF8jQGqjSR9bM=; fh=yKHXeCbMQsso1NxgOVkdV/uFDxH7ouiYYngvkSk4UXk=; b=uhvhYOGpMJ0fbMWh1VImeDdT0WBEkk3M5t2N/ljf0mp95TW0E5/sCaq1+tL37afiDv gZd21C/0SkWGkqQkvnhX+D2rUSPlUgRX6OBfjYa1F7zg2URAcddgmGRCyYe8GPons4xq xK1ac7MtFjTZeDShf0hMd71EJ1JCDb+0IIxoYl3vFw0GtRoNhtkfvfMlQ5OS9xwa06T2 HKZqxIZKXztWFfh2tZz54zeR0oHu64/KYLFqXeIN7yRqXuGsAnk0n1Ly1MGtYc8zNt6b 4mTmfRjwJau660OR/0E9cbRX2yvqZwPpSuUvXVIFh6YqW5I9BH+TVQ+fv5sjgfFq+Fu8 sNuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B8lBdqOS; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57546-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57546-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUFpjrP9u1r1h5O/pHov0KSyltkTXsAEoo1u9DKuhJrt9t5i/Utfek0zUQgz0JnSLjaa3X6JwFXlSaFNp87ZLdU9Ex3iw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x2-20020aa7d382000000b0056011550524si781096edq.374.2024.02.08.03.12.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:12:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57546-ouuuleilei=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=B8lBdqOS; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57546-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57546-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 50E511F24B8F for ; Thu, 8 Feb 2024 07:07:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD99B6A8B7; Thu, 8 Feb 2024 07:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="B8lBdqOS" 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 E319C6997B; Thu, 8 Feb 2024 07:05:47 +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=1707375949; cv=none; b=YnWe5VIFmdr064f+w8rGhjCuOgCeh7eNVbweTezsjBTZr4/fCoDUVaFy4FP/BJW6fgoxHrUL7lyO973XSP/8TfAZ6iangsAj4D27/lznb3AaEjCil6K6j8Rqq/0oAsJHOjTeDUeVZvRycLiSd+jrVcyTgpdPu+9Wojl8hxtfaoc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707375949; c=relaxed/simple; bh=zYJsF8OpWc7dj9/OozfDPc9dxuZGaqWmvnyjlLvPRpo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=h8vTv5Ueh9d97Jxb577lINA4NVq9382m563xq1sz/4lDDxwYjACjDzqRdUMzAxDGb8Kopeq5f/mzxJV7U0hWnl6VmKbHIus6Wo6H29MgyKtr53VKZGLwe+ryxCovS3DLowN8RhzGKf3olsOaV6e/ful2jF5gZbgowGcA/HsnJBM= 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=B8lBdqOS; 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=1707375948; x=1738911948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zYJsF8OpWc7dj9/OozfDPc9dxuZGaqWmvnyjlLvPRpo=; b=B8lBdqOSWHEkBo5YhmwpXLUyWL9B3OUOTYINxVfJUiHtUZjnYthjjDJH RQ4kR1UycEw0REMYof5Mj+wdbUG9pcxpsz9yiruxTbBssDMvMwvEfBNNY j2YE9nSf9gA1uHZ2jfz6oRTuqbPzDrVL3So5XnOeKaIEJKht8s61UGA2N hngO4ZNLWYkihwpSX9nBDp8VjScA6TqbHWIcEEkLH73EjdM+Bi8371Qt1 zMknz4+kOqxue7xZBgogfnMJJB6gsn8HEyEKcajo4FjUP7OBdiF/3YVKV Ec+E+fZ6cGNoHE5ya+g+15+tlJHnUNfzEEMeXpSnu0IgBfG0CSqqh/zUk w==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="12525875" X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="12525875" 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:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="1573972" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by fmviesa007.fm.intel.com with ESMTP; 07 Feb 2024 23:05:38 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 57D8B4841; Thu, 8 Feb 2024 12:35:35 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 578F41600100; Thu, 8 Feb 2024 12:35:35 +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 v2 5/5] pwm: dwc: use pm_sleep_ptr() macro Date: Thu, 8 Feb 2024 12:35:29 +0530 Message-Id: <20240208070529.28562-6-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790328982901036354 X-GMAIL-MSGID: 1790328982901036354 Since we don't have runtime PM handles here, we should be using pm_sleep_ptr() macro, so that the compiler can discard it in case CONFIG_PM_SLEEP=n. Fixes: 30b5b066fa83 ("pwm: dwc: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions") Signed-off-by: Raag Jadav --- drivers/pwm/pwm-dwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index cc5bba977f47..bb39cc34f895 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -127,7 +127,7 @@ static struct pci_driver dwc_pwm_driver = { .remove = dwc_pwm_remove, .id_table = dwc_pwm_id_table, .driver = { - .pm = pm_ptr(&dwc_pwm_pm_ops), + .pm = pm_sleep_ptr(&dwc_pwm_pm_ops), }, };