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++) {