From patchwork Mon Feb 12 13:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 199881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp15422dyb; Mon, 12 Feb 2024 08:09:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMl7mYR7VuAkKx6suv50b/KdMtj9EICQrNzYr2IhgXFE9UY8lBv8pE6MBnfCQdexGO0KVoIwGBjMECt8SrEoIMrs0WrA== X-Google-Smtp-Source: AGHT+IF2Qee9HSssyQYBJJo79KkJP2Y5RS9Wv3wmVpnRwpmNX2RUZYiJSudHiYXNNQ+1X2NKKNaC X-Received: by 2002:aa7:8691:0:b0:6e0:9900:117f with SMTP id d17-20020aa78691000000b006e09900117fmr5890432pfo.6.1707754183003; Mon, 12 Feb 2024 08:09:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707754182; cv=pass; d=google.com; s=arc-20160816; b=WAeOW0SxdoXKb4vqnl4d9drh3NFIU/oWO9b6Rbp/VOPuaB/l8GzUthi3ecG2vJNcHN ZBY0A8+0URY55jdxXOv+OynZW2lPdq620LZKk00o3wDuSQTbyFTVNabv1EAuzjj3TWWN 10x4V1JWpHeXFxPmD7aDbiJodNMQil1Ybe3RNaBFG21WT+noowZRZ70zLZy7Ry7SjZab /haGyA5nW43Idu+HJc3Ru+/IZeO/AHoj5eYnHqXGGTTn504i1U5mkSAXrFhh3/PM8umx fnL2AIHVWBtfkCueUtzwMiMmaS4TxmzAUxG3yv/TJ4Od92fCYcTUlANwpPY2ULyrqlVq XwOw== 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=uTExRYTL8nyB/jogDWWNN5I63pwfu7vH7I94RU4tKBw=; fh=qsE4gJi/qP8Y1UgwL5BO8AUnyDE8c4nObkTZnY3SnxY=; b=E2f3BKxzDtBJpKHWAl91YD7cYLLN1Sq108AgyN9tZPfVJvaJ5KI+jFKb46FovWwNVL ex2s9v607yc7t7pKPmUai8s4xxOvCPvjQk0ShHsFrdQb+g9od1ka8ip4fAriktk3BQVk swbPsiSwYl3Nty3SJRLRSTnk1YNQGFgzIPN5wxhC2zGCRQH4FBulOvK2dH6kVuf3a1oj sdsBOLGADBborZrWBb0ZeBs5SbB5b3zzpe9/hfYKmwSFN2PzfS131+yU3FyA+sFtQkTO tePWCyGpsGX7SmRpe7iJG/chxHBwfP5ag5+hXIfglJa8nVVoTSrxNXYufkv+8xq3PWv0 hJKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c5N0YQ00; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61596-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61596-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWu5XRk+HJENxpT1p5Z18FtN558JUrPM3VabPIbbvOdp/+pxSNwffdAUNXpz/CG9irhWpV6KlW3qIwhryl/hF9QKPjm6w== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j185-20020a638bc2000000b005cdf37c9c29si448699pge.703.2024.02.12.08.09.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:09:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61596-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=c5N0YQ00; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61596-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61596-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 F3FFB281346 for ; Mon, 12 Feb 2024 13:04:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 713CE3C064; Mon, 12 Feb 2024 13:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="c5N0YQ00" 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 AE4613A8CB; Mon, 12 Feb 2024 13:02:56 +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=rC3ntrSbZSSTKLipimGEty5/ByYzyBz6KetL1tRqRFVvxvM0peKkVp6somb7rV+614AuzWcoMQOVSbwWx8zlXong0504ESrOE0JCNHYO8WawRrn9Vl8haqPCRGP34gBXhMMELjQZlYqcaG/vBQ9ntNwtAi7CnDvbSxZReCC4l2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707742979; c=relaxed/simple; bh=B3s2F89GzkRqiCuF715R3/bfNCpfUIA+Ssd1CZYkmYM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YLm4W626qoX7GHdUFK+5NUwF8vTmHWhXKIrT4XhONyuhJ1dzwNuw0gmeBwFf3RIxP1wvPaYpWCNIB8CeT/ac9y38zBnXLvKk95Eq5bqs4Yljy68yetsq9EkgtUtJqn0IWBVdg+VbOoSjQqSeqh2BUm4GFimmj1AYHEeGDjQPZVs= 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=c5N0YQ00; 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=1707742976; x=1739278976; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B3s2F89GzkRqiCuF715R3/bfNCpfUIA+Ssd1CZYkmYM=; b=c5N0YQ00+km2atJAvKL6Qz9OIf0gPKhRXUc+GEa/vVE0lXAcyrzDkeMB aflft9KcFCsYb2F4cwMIR37SUqR7RkdNZFmGBlo9nlkgHmJStN5fE1LWY Bov+ugEOMIeBPcTNbvLEs5kQGfARtZ+rrQkugC9B3O9Y9ATo6qNmHBgRf XfcT2YeSor9osh3vVlXLE9DDH030ksLnd8xZVdnoT4fTLThq9l+WXAd6o UDIjJXiaXNQGqxzrxpBXxGmmE4jECNxXZbkXGNPM/jECk5j9dtk3oV3L/ C3Cp6D97z0UMPJDoiXynyM+eQNRva1Sz6uJDm33LLPwZVlr1CypwfBSKr g==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="1594836" X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="1594836" 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:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="33378392" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa002.jf.intel.com with ESMTP; 12 Feb 2024 05:02:50 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 5756C1CACF; Mon, 12 Feb 2024 18:32:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 541C51600101; 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 1/5] pwm: dwc: use pm_sleep_ptr() macro Date: Mon, 12 Feb 2024 18:32:43 +0530 Message-Id: <20240212130247.9985-2-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790710050211413778 X-GMAIL-MSGID: 1790710050211413778 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 Reviewed-by: Andy Shevchenko --- 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 4929354f8cd9..a4a057ae03ea 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -120,7 +120,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), }, }; From patchwork Mon Feb 12 13:02:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 199916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp34113dyb; Mon, 12 Feb 2024 08:41:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLV58axp7+FGFHCVfP51syJMmKJRyQSM2we/jQ+/GURQySbdu3ihfvyX79nw+OvBqlB+eM X-Received: by 2002:a17:906:8305:b0:a3c:b354:b947 with SMTP id j5-20020a170906830500b00a3cb354b947mr1649615ejx.24.1707756083936; Mon, 12 Feb 2024 08:41:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707756083; cv=pass; d=google.com; s=arc-20160816; b=nW8n7C2At9Vhxz8RCMBZc6wPTJqcxSmdzOpqxREdDV3cdUD+gSQVrqgBi1gsuiWGBH 3yelgFfLHmPkmOSbwsn7N66fOgwdEwodQHe8nUesPHom2+HqEfrdwIycYxuZjW6xIxl+ 8bmdDQkArV158VOqBjqWdWGkik2yKAtdLcHSX/L+r1t7dv0jXKNfZb4KUF/J7avkxrVs AroG+X3hLdfQI/sjqi6Qx1bUH9/az7PoEsWOG8004oSo87375P0DTsbEHOVvhaNvcn2F g3+WAvU3o9Wrxyq360ftshHrGvVmvYNXmoLSuxOb/CY++U1PuhPaaC7VXAwm7PBjz8nK jC+g== 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=9ZVq9PbY9jhCQgQcSl8HbYK6MFvocqtBlpd0akSo818=; fh=sDuUUKmfqBmZ1sTm9CmasCKzrcACZFDW6pJZ0+Uz8rQ=; b=SOnUxSW5OcTWVZZkBhDGxEU8oLJAsVwVs9XREf8BZ1laQEeZ3Ddg8O26z6EsntyJIQ pQbv2lMkPlT6BnMnrtqv37pgxrmnj7KhEPdfnJlLuUNj+ndIZnIYAWXmpWFUow7QHUm0 sSIir9rB9+HJBW4WEqI+tBHwg3qDDWxIdj36J6OgSszGtSP124Xugnc2gJ2Ssj1EZGmm wSUTTjzNxPX+n+u2k4RWeuLoy159bNeHoxL5rU2XcIrXbHAc65CQgJT8Hmwte9xdvWsk YV+wnHZX8R0PFA5ayOgJWQ0VXgW1amsE+Zp0VA0+wFY34X5S8LRO9E8tOTX8HxpdLYqC 50QQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DINeFvUH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61594-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61594-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCVfy6P0gF4D6wGU+iEED43b6tfFvNCuYTZVouKLWiUnxMGOBff5E+PohaPZlnvzfyt4SgAGIfcXwqvSPSKeQ1NxZ8wf0w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a18-20020a170906469200b00a3bb5f818a4si348515ejr.161.2024.02.12.08.41.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:41:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61594-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=DINeFvUH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61594-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61594-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 E901B1F2785A for ; Mon, 12 Feb 2024 13:04:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE1A73BB2A; Mon, 12 Feb 2024 13:03:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DINeFvUH" 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 E64063A8D8; Mon, 12 Feb 2024 13:02:56 +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=1707742978; cv=none; b=kDNfbQ84feT7OYivBWAeVTVpYcAkoGHD5Owm4bYDYDxDVLnXt1rG160XLGy6xUKgMHzv+1oM2e16e2CZHSZTMu681V+Jz8EqN1a/859SnYO7ZBlGT04qj2XK5l7RnguvrRxNIWKegl+uYIKMrzDSxvn5iF1/2K0zeuDVvRjI6Xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707742978; c=relaxed/simple; bh=FOjkuLNdMv7J4yMpAY56PojaEyEBEaN6z3QYgOvwO2s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aAznzhktiIXrPo7Q3rpMuLpH9ve7wVadFYhV0Rl5LPzxmb0Ugv6K7el+Ob0ldvgT3kEiR3ZW113Aucm+7l7LjQh9eSygi0tldPXZgzoFcp2axUsTyw7gTBIoxjmX66d9sqvMOifjv9YDuP8ecY9cX9MvTbpZwXwCqiRiQ0tAp5g= 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=DINeFvUH; 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=FOjkuLNdMv7J4yMpAY56PojaEyEBEaN6z3QYgOvwO2s=; b=DINeFvUHtG1mPYSJOWIomQz4ZHG/ROVL2nmmD2px5mxlb2YSolm1hVV7 mUQfvf5vlOgnR4bCv188axvJQd7Q/PKczpWXigrYc9IJjT4XbmgPCzShR kpgtcq73V0emfrWovv/u0GfctziYGgO7IQpMLyBlHumqcwyjLl0z5eIZC 1r6+plvCRVszUAZT+f2/044uBiWQpLmpmkKFvDV53Im4TqETsKVYmI6s2 J6RMgmCXCG+TFDAjukh7NPLcLc/zr/zMITG+FKQq62KS4nNhBy7MCa4dH N2c14ytor43IvtWLoZGFjJEz1Nbphtu/xaV+M0ZAwbMWEpm297aFnPfQP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="1594837" X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="1594837" 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:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="33378393" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa002.jf.intel.com with ESMTP; 12 Feb 2024 05:02:50 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 5854D1CAD0; Mon, 12 Feb 2024 18:32:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 546041600102; 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 2/5] pwm: dwc: drop redundant error check Date: Mon, 12 Feb 2024 18:32:44 +0530 Message-Id: <20240212130247.9985-3-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790712043593408505 X-GMAIL-MSGID: 1790712043593408505 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 Reviewed-by: Andy Shevchenko --- 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 a4a057ae03ea..b9e18dbf7493 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 Mon Feb 12 13:02:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 199875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2501001dyd; Mon, 12 Feb 2024 07:31:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe+CxXblejWmJhq2urXqjDfymmH1S9wqITvrHXYf3GLyd70FBKq9PWfmHw4Er0JoG+c5/6 X-Received: by 2002:a17:907:f8c:b0:a38:8c12:9c3a with SMTP id kb12-20020a1709070f8c00b00a388c129c3amr6947574ejc.11.1707751874982; Mon, 12 Feb 2024 07:31:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707751874; cv=pass; d=google.com; s=arc-20160816; b=BHD+3EEF7+3RH2y1d40z3WhCKdTEppd/NGsCj81AnIThuY2h/XyThmAR0SMjkJcUCb H+nOc7v6Xpcl1fsYYZrW3CyzUjrfmpv4LsZUlAMQsxVDCaqcuBrzXjutf0+2aYOglm5p erTabna6yaujRZ1TN3l3b7+hViIgKOYBxG+AT+AIjAncRCGVpfIBH3TXkcv1PrVExgwD zr6niPtGKmu1RmFUztWzV4hFzQPw56PkfRhYx0d38GKwphc3Nk8Mk853UvJK24Sg7Zwn RT2Eq8LbHtpQkETaia8GUV1aWBXw7k9qehYJ4XfMl/ufTrJxx4/8UE46Iq3zlH73ChJk pDRw== 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=T0+HxZYYnRW0oo8wDFQHy/PCaY6iwb8u1/d94wX1Vc4=; fh=bfmmaDpgW0HDjZG9B/PEZ32ito3cUN0l8pSghj9h2qI=; b=Wq/HT1c9idX6vmYdBJVeTMOSMc8jnx5boQjAJfMZbn4eKEn4gRJxcL0oan+vO60VTU o7tApfktRBz7h5GHIid17mwSO/Fe/ULgLGxxWznLUpTAvx7lmYSzKcAzU9IxRJannAGF NCjcDBKgEcgtRCARSG0ZiNNCddrE/9ak4cE74A9s6m8ylzbOGbOdsXw3N4uRl0sJI1FT WFoPlNWH0fNuqVG9d6wi3hjr2zvjEnM4uiMGOTXCn91J4wxzgYeqPMXXXVbAXUN5IPjZ 6EuZQOts3Qsy1e+8Oo8Hy+B5/2WLR2o3z4p5U504b6cN1bZYYV0CR/0mBseVG2axL0pm QY5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UrL6v1wH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61593-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61593-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXSTSDELRi3oWu2YYGxp6WvQjwOzjPeHc4l4rOdyO8OAECkc0k8dKxC9EwPJb3Hsd6JfqvYfAnHtEZtx679pVh9K7tBRQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e3-20020aa7d7c3000000b00560237fc991si2809147eds.541.2024.02.12.07.31.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 07:31:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61593-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UrL6v1wH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61593-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61593-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 A6ED71F2757F for ; Mon, 12 Feb 2024 13:03:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0F0C3B2A2; 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="UrL6v1wH" 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 3EA743A292; Mon, 12 Feb 2024 13:02:54 +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=1707742976; cv=none; b=nqdIVrX2x6G6RgoWRmwHeVb/3iuQvSDNxs9E0oP70Kz5P5uHTb//SNnvVY/e1goYS9ewtiAC+bG4c8Lnie35ovySLC8gNb6YW4p7sh/gnlHUcIio28GW4d7QDyPgyPWvDKjpHD++ZSqppuLCB0++F79ng1XdyxVRY93J78Zhxhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707742976; c=relaxed/simple; bh=v0mOMqEEhZI5Srf3XL6JSewIp0AoLiBxxHafw44lB8E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rXkwHKacsPuWxdQET5+kA+vocNwzFhR1ahVyjP4a+O5xdURdbX17dSNMBpjij/2CiDsR5Ku1/iMPUdLJwNz61ITdn7MDfbaWv3cVM3aV/VtlCvT1u58TXyLjqbnqS/BsdfaO2u3oi/d+sBuJ9mDv+DbCbO0uhkgTTpoeku4yQ8k= 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=UrL6v1wH; 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=1707742975; x=1739278975; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v0mOMqEEhZI5Srf3XL6JSewIp0AoLiBxxHafw44lB8E=; b=UrL6v1wHPUfvfomnhS5ZqEzEOAbn+pRqXZJFrrd2Ph4nuIM0B5jNgVOI uc0Zak3RVDr0ea2Kj9fVih3mzmhmOHOAbMs74m6vrASvO5moqdNcfdQpA yIf9aqxlw706EAq2YGiB8a+14JW/bjXBIlI0RDhKKn1n3b6CxLrPqp/C6 02ssmI4KNm43W0UJE3/kTK4GOCKFnlNrs8CeOxBMYgm+Mo8K2Xdf+CWrr yoS02rWg4HcDxxIKeE+JZ7rEB88PtXUm2N6OLLcAgPDXHzfdtCAVTga5D YY4IU4X5broMfmSmV29tRP6cuvNzO0Wy5yPsMuQ13NaPnQC37gY4R1GbF A==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="1594834" X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="1594834" 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:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="33378389" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa002.jf.intel.com with ESMTP; 12 Feb 2024 05:02:50 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 59E7A1CAFE; Mon, 12 Feb 2024 18:32:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 54A401600103; 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 3/5] pwm: dwc: Add 16 channel support for Intel Elkhart Lake Date: Mon, 12 Feb 2024 18:32:45 +0530 Message-Id: <20240212130247.9985-4-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790707629861288752 X-GMAIL-MSGID: 1790707629861288752 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 Reviewed-by: Andy Shevchenko --- 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 b9e18dbf7493..6d922afcb20a 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 Mon Feb 12 13:02:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 199844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2456828dyd; Mon, 12 Feb 2024 06:20:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU17tjFfHXB7hrB1/jnFjBiooK/UGGi8zjyniniDmN4KCs28HcT04Rw/hiJUktj1BqN5CKtVR3684LufRvJrrQ8sE/QYQ== X-Google-Smtp-Source: AGHT+IGIusqHG+950KTZXXKyzeHTTQLor9fHfxAM8aVPJtzUPGcfV/CW7ctg5qTWQygCc0oFHg7c X-Received: by 2002:a05:6214:458e:b0:68d:516:53f1 with SMTP id op14-20020a056214458e00b0068d051653f1mr10505750qvb.27.1707747613017; Mon, 12 Feb 2024 06:20:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707747613; cv=pass; d=google.com; s=arc-20160816; b=bqaCkIAckdF5D1FFBt0HliRgim5+ocBvbIMJhU4N2bK7Osf38gt8qOc2bmCroNp4NS VQYLYMNqhOT1Id2Ij0ZQiDLr2CFQUZPg6gvVmIETgu1eETCJ8UW7NQ4MCSridifNNEvA bDXLaPJehLyDXj/gxFAxMAojWB2ccXwSoXHHwG9gt1IRq03NAgVx4db3MOswTNgyyYZP umQ+BsKXK3ryKzot3GJKkQU0Y3BRzFgwgcPRy513ifRg+F/Lg8z9Pr5BJ4kkGtjXUrA0 OgTby0ekznV1MlVGbihPwPVHO7q7Dv+AnhAoZE5HQwGcBWO7LSnPi/qqBZlnrEZBVv29 GZ9A== 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=sfI38VQNhq+tsMuMhBuC7Oi5QAmUhypjNVTBvT59Ars=; b=jMdPg68kFVvxyULT0q/l8lYV03gJ2pamKmjxXo2PzNWInzL7diWi9jGr+NpO5upEx6 qccWA+K5mMDxO1Wa7ueTvu7f6kF/LCtYaK93M8x3/htbm1frO3vLG+MRJyN+/3w2vcMq 7h+qfQHfEpnaKEZWpdA41VjAuoYreNotB1+DLLHuMfsjhctaFm3BUDr/5V1yg9lkTNnf 9Hu+bqy2v8fskuupy8oRTPPZ17swu/oj+UsosK/0WfH0reLl078jGGUkX/jIUba6GOvY u3UQxgQtvIwrwVXY1p3c7iK8Ml7G12MhwBxZ0dgyN1UjVmIaETGIfSrBeOwp/fM7NYy7 ArDA==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61595-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUNCzx6TloG4+ScdSO7hKOqZBu6yOScCU39xEsDBu8QhECVcIyO01lQlFnCsA0C/KdCkHnRTej0mO94Ex4Lz5FvOgdbDg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ey3-20020a0562140b6300b0068d0f07f562si472309qvb.427.2024.02.12.06.20.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:20:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61595-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=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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61595-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 26EA61C2357D for ; Mon, 12 Feb 2024 13:04:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B092E3BB47; Mon, 12 Feb 2024 13:03:01 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790703160816004225 X-GMAIL-MSGID: 1790703160816004225 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; From patchwork Mon Feb 12 13:02:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 199871 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2487396dyd; Mon, 12 Feb 2024 07:10:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUcGE3BoMxDxY+r71Egu3LY2A2r4xwAekRrERZd9o+I5mwjm31PYUL/MW8Cf/o6E62s+bQ3SDiBz943Y6UdsLUkyrve2w== X-Google-Smtp-Source: AGHT+IGntCw7JT5adDiL6NTa3xvcWShFuDztkI1IhOEdATaYnizWlxuhOc4AhVGuWHmAN2fLHEFW X-Received: by 2002:a17:902:db02:b0:1da:25a9:ba12 with SMTP id m2-20020a170902db0200b001da25a9ba12mr6199053plx.28.1707750605429; Mon, 12 Feb 2024 07:10:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707750605; cv=pass; d=google.com; s=arc-20160816; b=bygazlHgbpJRUEjUJCMFlo1UUQ9RRNgxABWy4RKVGYlFdwZDI3Apm277dkFoCmzxLN b6kqp8VKa57h8iX5oJRB3KnenWVzUvXb72vpIyralh4IiydVKqkaWrKHIkmxfM7IhXwK EyqwIPXQaNfsdugUpbguWWMfBRb52/0TLt6t66AZYyIgolUiUVdkonTzx5MXV5Ev43Co 872kBNkbrYA3UeDu+5xLwHE/GLyW1iLb7YQ5uvN2fBpc/844XMi3NNrlKF2YzliCobIA IzjaBrfI2/zkvXly8R1P/8GE5AqeRPU6ktTRYlQ8K1uT/uCceg8QqNvG86IPG0QV2Ogf 6jSg== 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=Z4ecoytGA1aNn3qu4tlj6Uvzdb4dF6Nt7TwXOJ84ncY=; fh=XpoiJyWx/DwXxE6r9DA0AWJ4LjzZ1bPAdwp9Szh9DgI=; b=N1LkYBFTiTujc1bQJENRDkUjPtEeHoP7F7JCs9MD9jlWskH8VfhFvrWiOUf49OTvPg 1We8t+c7E8W3k20BB1WTiazhHpHAzbaDgOKOClxJgomTlhwrMhpUoXz1DdKBrmqm74Pi 1F/E25ggDPVX9IRnURZtbC2pPDQdxMHllkzHMlse+w7L908oJAUIbo+XpKEF9ORMxK/k LQMHKHLQr8CCNHLHsuDuaLyDAZf3PeXH8TGvkB4Nkf4fxnyJSs3CUfMhvLl3vuj6bLQi 9XJuwWe8qItIIgKJXhpBX0esPnbzzQkQowi6c4uIUcPK2AmaiYqXgz+3l4JXX2hYynmt rP0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=klqEjlbh; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61592-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61592-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUPFnvs9AilN61uwZTMcArmiSs7HDP4aEonHucH5OD/lTl0veVUz7sceIs/hWhMXoDHvyscum5ZQO6RHiRyiXfiX6Vqjg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d13-20020a170903230d00b001db28b0c06asi354102plh.329.2024.02.12.07.10.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 07:10:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61592-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=klqEjlbh; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61592-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61592-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 C69FCB21AD1 for ; Mon, 12 Feb 2024 13:03:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35FE83B1AB; 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="klqEjlbh" 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 E03323A28B; Mon, 12 Feb 2024 13:02:54 +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=1707742976; cv=none; b=jzAvhBHdzFDx/OqWC5DK7U1QF4tMIiCmJltiLJUd9yYIG1OefP+s+33dRv8EmV1EFcLxGnb3mLCqBBcZPdT0qYUPt2QIiZakBWSG5MAM0pDaNxwggPmb61wrTNYuSkU5qVqvT98G1kdDh4QDG19q/+pqmcbXWFhzvh3fgizpckM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707742976; c=relaxed/simple; bh=uje6c8I2tiqtfUYQ+9jgDQlGSSLDu0ZZYftu8pHhS3M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JNIW3EJALMYPLiOZMBk8FS8SVybJpI0VFnYkcJLQFS5JsQ17fk2a3bAvhigQnyNAQ7ZKDl4pXXxgyBxgUY8ABnk/+IIJM5gieZHhnap+9a/+ZmmcrbupjD2Gu50XwgcjfKT7FsJwDw6+6tle2DchhZ5cDFO9fQMBFWKxBKkjQiw= 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=klqEjlbh; 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=1707742975; x=1739278975; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uje6c8I2tiqtfUYQ+9jgDQlGSSLDu0ZZYftu8pHhS3M=; b=klqEjlbhGogFUcn0Ao2WhRGI1+6gA6qDJaPBUUfYKTYLG9yXDPJ+ZiBG NTt2RBvWZH1R85I5nL36AcQFSbqcPpaS4bNaV6jcgNTDfn2lZQqKSU3bx Fa72xmPrbWREqwiM9CfG8xiXtRgkd61V6gZcD3tEgaTaLe2HiOqis43nE Hfqgz740ig0Vnh4XQV1fqsDrf/T6mXEH3KKqS7AVTwQuhnJ6gQGubsLTH YBwYu+rTdFl0Q3HmKiWlR4uBYvT36dX0Z0ICa7YDokHN52B0MAOT+FWZo CoT3T+u0XtLWyZVVf3oSYD1/5PTsuuDICgTt5Gfkx9h8d2qEYpM8kV9V6 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="1594832" X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="1594832" 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:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,263,1705392000"; d="scan'208";a="33378387" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa002.jf.intel.com with ESMTP; 12 Feb 2024 05:02:50 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 59E3D1CAD1; Mon, 12 Feb 2024 18:32:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 56F421600105; 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 5/5] pwm: dwc: access driver_data using dev_get_drvdata() Date: Mon, 12 Feb 2024 18:32:47 +0530 Message-Id: <20240212130247.9985-6-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790706299070882927 X-GMAIL-MSGID: 1790706299070882927 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 Reviewed-by: Andy Shevchenko --- 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 56fac8655c7b..ed56b796b670 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++) {