From patchwork Wed Feb 7 15:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548662 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 046507FBDC for ; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321121; cv=none; b=PnyTbWSlFOZyJnPpCzZ+BkMYfxhQBHtncVRRPTUhlKD4N6saXOxdnTJVWbRKZ08Ozq6CtSm1XNXQJM/fq2CZwR/9WrsIpTYubEHFb2uGUQJRfon0eFu6UjNLxRYpjVMMHTecJZ4jLMDdoxCg34lQIDOsXfRD3qbrQhvEXqaQc0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321121; c=relaxed/simple; bh=u/Hmthk/oY2z641D7wxQQcp3OujBgVy5OagUF2XOscs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IIARgEMEhLq/DZIHXnBePIId2wD4hAugeTLLPCVuMCvyil1sLN1kEGO1DCaNwMte0a9IQb3BPOp1Wn0RkYEyu4elSU7H9kj+OMtbmGfUW+9uYkrde4mL2HLVHBJIIatiRK1gIBEcw0XFA1kbH3WbH7/1Y+1x6UX27C2B/4T+v20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=V5ircxCY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=GmvR9NM2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=V5ircxCY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=GmvR9NM2; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="V5ircxCY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="GmvR9NM2"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="V5ircxCY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="GmvR9NM2" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1D9AF222CF; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=90dOLoGPXIt4waCEstt1PSJ34YASOo9TwS+j775ujVc=; b=V5ircxCYXzKYiQFTc4rc73X6WuJa9AeKlnAxgHnbntQLE5240daM6TInFPiU9882I1e/tT IG8er14ii8Ja5itrmjQ7juWIEJ6nvQTXZ6fv5hjfiGH6tA5XPUXiVW6aYeko8AYGVxzYlb gbsCOUgOA8r0e3upLII0XT4VzVcKQrY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=90dOLoGPXIt4waCEstt1PSJ34YASOo9TwS+j775ujVc=; b=GmvR9NM2Cr7FGLWQm87lQpKE5VfHmVeAROPsnZaHY4d6A21QzsnGbYV5BLSGOCONxtvUJ8 /yxPsCYdFEApzFAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=90dOLoGPXIt4waCEstt1PSJ34YASOo9TwS+j775ujVc=; b=V5ircxCYXzKYiQFTc4rc73X6WuJa9AeKlnAxgHnbntQLE5240daM6TInFPiU9882I1e/tT IG8er14ii8Ja5itrmjQ7juWIEJ6nvQTXZ6fv5hjfiGH6tA5XPUXiVW6aYeko8AYGVxzYlb gbsCOUgOA8r0e3upLII0XT4VzVcKQrY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=90dOLoGPXIt4waCEstt1PSJ34YASOo9TwS+j775ujVc=; b=GmvR9NM2Cr7FGLWQm87lQpKE5VfHmVeAROPsnZaHY4d6A21QzsnGbYV5BLSGOCONxtvUJ8 /yxPsCYdFEApzFAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F04BC139B9; Wed, 7 Feb 2024 15:51:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id UMWANx2nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:57 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 01/29] ALSA: aloop: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:12 +0100 Message-Id: <20240207155140.18238-2-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: * X-Spam-Score: 1.07 X-Spamd-Result: default: False [1.07 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.63)[98.36%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/drivers/aloop.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 1c65e0a3b13c..892c4e29c0a3 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -1830,7 +1830,6 @@ static int loopback_probe(struct platform_device *devptr) return 0; } -#ifdef CONFIG_PM_SLEEP static int loopback_suspend(struct device *pdev) { struct snd_card *card = dev_get_drvdata(pdev); @@ -1847,11 +1846,7 @@ static int loopback_resume(struct device *pdev) return 0; } -static SIMPLE_DEV_PM_OPS(loopback_pm, loopback_suspend, loopback_resume); -#define LOOPBACK_PM_OPS &loopback_pm -#else -#define LOOPBACK_PM_OPS NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(loopback_pm, loopback_suspend, loopback_resume); #define SND_LOOPBACK_DRIVER "snd_aloop" @@ -1859,7 +1854,7 @@ static struct platform_driver loopback_driver = { .probe = loopback_probe, .driver = { .name = SND_LOOPBACK_DRIVER, - .pm = LOOPBACK_PM_OPS, + .pm = &loopback_pm, }, }; From patchwork Wed Feb 7 15:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548663 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B75980025 for ; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321121; cv=none; b=lbjigCw3tGexr6z5GbTOtBu/T6titbu/uL1En7gWhWdCoy+5WcOhtvX329e2BuxB/G4YhdFGPamj7nItJ2If1nFx/ynEHgc6tL7T4jbHZRPnw70jhznyEHpimyplDp92dRqJsbJJhgVGpE7HN5C1dZaV/eC/Za5mCnjhsDUUF1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321121; c=relaxed/simple; bh=NADiDpOHVPGkUPdX+RtRYzKOE77wofYnm2SQ6UONfiM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PjrKJWbvEYQZr+8BdcueGxHbxLvQ8OtWnaqOxsIW8amypfA2fiYZbSbZhHFtklLqMpldBZ7gRCDseBDlPfPWg27F98fHTjp2SDarJNQBGWRORfYhiJIFRWRoM3yvsD21aZvkyncsIRTiVSu8jIsBUUysA/gnEg3j1nUGjjBEOPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=JxLBwYhG; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=B4sRFey5; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=JxLBwYhG; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=B4sRFey5; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JxLBwYhG"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="B4sRFey5"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JxLBwYhG"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="B4sRFey5" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 44C681F78B; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UFiBIN5aqjHkHLH2HbX1vUuPotltfIbfJ84MkeIOIr4=; b=JxLBwYhG1dsjE+vyHiCwD2C5/K3Ko4u/rXCkE4HW9QYox3qfs5FSNuoAn0mUWbEMnNmcqC 9T28WeN+nZbO9XjOYyc7LUeyafY1B/vsfv4+qn6UzDe2Ai6Nm/UNqUsGKaaxJWUQaepjSO XA4LkvBbdq5QW5bRQP42cwzQLEwDfJE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UFiBIN5aqjHkHLH2HbX1vUuPotltfIbfJ84MkeIOIr4=; b=B4sRFey5fWAsBVv8FTDA8BcFDqpDZtlht5OzMHId8K9koUoC6dzXNubud6XOdO89Yo5flK zZmSHcndzajdfJAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UFiBIN5aqjHkHLH2HbX1vUuPotltfIbfJ84MkeIOIr4=; b=JxLBwYhG1dsjE+vyHiCwD2C5/K3Ko4u/rXCkE4HW9QYox3qfs5FSNuoAn0mUWbEMnNmcqC 9T28WeN+nZbO9XjOYyc7LUeyafY1B/vsfv4+qn6UzDe2Ai6Nm/UNqUsGKaaxJWUQaepjSO XA4LkvBbdq5QW5bRQP42cwzQLEwDfJE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UFiBIN5aqjHkHLH2HbX1vUuPotltfIbfJ84MkeIOIr4=; b=B4sRFey5fWAsBVv8FTDA8BcFDqpDZtlht5OzMHId8K9koUoC6dzXNubud6XOdO89Yo5flK zZmSHcndzajdfJAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 23ED3139D8; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4KY/Bx6nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:58 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 02/29] ALSA: dummy: Replace with DEFINE_SIPMLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:13 +0100 Message-Id: <20240207155140.18238-3-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JxLBwYhG; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=B4sRFey5 X-Spamd-Result: default: False [4.19 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.50)[79.94%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.19 X-Rspamd-Queue-Id: 44C681F78B X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/drivers/dummy.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 4317677ba24a..52ff6ac3f743 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -1098,7 +1098,6 @@ static int snd_dummy_probe(struct platform_device *devptr) return 0; } -#ifdef CONFIG_PM_SLEEP static int snd_dummy_suspend(struct device *pdev) { struct snd_card *card = dev_get_drvdata(pdev); @@ -1115,11 +1114,7 @@ static int snd_dummy_resume(struct device *pdev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_dummy_pm, snd_dummy_suspend, snd_dummy_resume); -#define SND_DUMMY_PM_OPS &snd_dummy_pm -#else -#define SND_DUMMY_PM_OPS NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(snd_dummy_pm, snd_dummy_suspend, snd_dummy_resume); #define SND_DUMMY_DRIVER "snd_dummy" @@ -1127,7 +1122,7 @@ static struct platform_driver snd_dummy_driver = { .probe = snd_dummy_probe, .driver = { .name = SND_DUMMY_DRIVER, - .pm = SND_DUMMY_PM_OPS, + .pm = &snd_dummy_pm, }, }; From patchwork Wed Feb 7 15:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548664 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B71780024 for ; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321121; cv=none; b=ewNum2Zt3t/+Gxy+u8HJORa8UFe8vTKOQzLvvRPFw66hdcdXeA07L7DqnBm3Fos8PvHNKJ2PBsp8dIVbggV79Mc47mxhZ3/tARbAHKH657R9N2ON8Y/jZHH2xR2mD+IE1mXifmZ6r5Y9Ex0+e1k4vbFGmDeRM0tjg1fDqNejS1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321121; c=relaxed/simple; bh=4kOLIGa1YWUoi0wMHH7ciygmsuGiuPYZIZNU0hXbx4I=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oOIAToeUE0fRRoi3mgan9kqRd9djPIg19mHj7EhUNAHKdh0vZCwM1KJgcqqrEL5W1UCds04OF5pGuoZJK9m1kk+G20phw4CWqEPsjs+vOpAUXvgmFjq4jiSBCglEok1ZDYGMQLjrGYJ+3lUiv3BNh47tJpJGbq5SdpRMstm7uKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=vW7d3kNq; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/3zIvyOl; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=vW7d3kNq; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/3zIvyOl; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="vW7d3kNq"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/3zIvyOl"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="vW7d3kNq"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/3zIvyOl" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6F3621FBFA; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r5gCCxF5xoJ/8ZjJ2Y7PSheqLSQpE13wPX+A4HTTq7s=; b=vW7d3kNqarhkHcxyWYhfUaIK9GdqKRRxIBrdbU7M7T7lwrm813YZmU1xRljcr38BQZlqGa sjK9friYsY3zBW0RHGQ5HhOO+IrMBLX5D4etohz/T53BqW4HKJBtsIW/tro8t735Mk7kSu /12hkJjpn4EabLeG+CgPG8fTjkkAlss= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r5gCCxF5xoJ/8ZjJ2Y7PSheqLSQpE13wPX+A4HTTq7s=; b=/3zIvyOlgs6QpFdbhTChEngU7mhNFlevgFpiPwhZnn8SxB9jbDlWksYyaGekj2lG6fCcpl gIw36QngI9npVcDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r5gCCxF5xoJ/8ZjJ2Y7PSheqLSQpE13wPX+A4HTTq7s=; b=vW7d3kNqarhkHcxyWYhfUaIK9GdqKRRxIBrdbU7M7T7lwrm813YZmU1xRljcr38BQZlqGa sjK9friYsY3zBW0RHGQ5HhOO+IrMBLX5D4etohz/T53BqW4HKJBtsIW/tro8t735Mk7kSu /12hkJjpn4EabLeG+CgPG8fTjkkAlss= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r5gCCxF5xoJ/8ZjJ2Y7PSheqLSQpE13wPX+A4HTTq7s=; b=/3zIvyOlgs6QpFdbhTChEngU7mhNFlevgFpiPwhZnn8SxB9jbDlWksYyaGekj2lG6fCcpl gIw36QngI9npVcDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4BEA9139B9; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8I3kEB6nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:58 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 03/29] ALSA: pcsp: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:14 +0100 Message-Id: <20240207155140.18238-4-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[35.63%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/drivers/pcsp/pcsp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index c7be1c395bcb..7195cb49e00f 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c @@ -176,7 +176,6 @@ static void pcsp_stop_beep(struct snd_pcsp *chip) pcspkr_stop_sound(); } -#ifdef CONFIG_PM_SLEEP static int pcsp_suspend(struct device *dev) { struct snd_pcsp *chip = dev_get_drvdata(dev); @@ -184,11 +183,7 @@ static int pcsp_suspend(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(pcsp_pm, pcsp_suspend, NULL); -#define PCSP_PM_OPS &pcsp_pm -#else -#define PCSP_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(pcsp_pm, pcsp_suspend, NULL); static void pcsp_shutdown(struct platform_device *dev) { @@ -199,7 +194,7 @@ static void pcsp_shutdown(struct platform_device *dev) static struct platform_driver pcsp_platform_driver = { .driver = { .name = "pcspkr", - .pm = PCSP_PM_OPS, + .pm = &pcsp_pm, }, .probe = pcsp_probe, .shutdown = pcsp_shutdown, From patchwork Wed Feb 7 15:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548666 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 634D480028 for ; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; cv=none; b=dOYHZi1rtY1sjOnThpdVRCa2UGnIsAZj+3bzbqzEbVKLl9A6NE0T2ttB7/hsK6oLcuXGZr2EZn5vZu6uUTOFZchR7WLOGTROpUkBUeLb1nWaOPS6//2H1IHBuEtq36Oo/5D5i5QJu5tBl9Bn1c1rMqtYHq0vyDRkaXACOihYPHI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; c=relaxed/simple; bh=nsJtj8qhVFL+3mtj5ZAonAaccXag+Af7+CVM+BsJ28c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FlQakqq2vAc0EjASi8YQeVuMqpjwSixSLNFzXkI5LqAltEuceDRbzSCEXfxZndnJ9PNhP0p+2msznQj7lPHvbMX4acXDhn0xncVT8xq7oqG51efT8QWGw8AIdAue8QOVhTmUvkfSI8SO71b9CnfLxmACj+z6PihkXBue+k7Nni0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ykBMsk8D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=QjTiXAo6; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ykBMsk8D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=QjTiXAo6; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ykBMsk8D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="QjTiXAo6"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ykBMsk8D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="QjTiXAo6" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9132522309; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4O/ZYs/He7pfI6AUNXbDMCwWsBjBwN7YH7BvPFY86sk=; b=ykBMsk8D6HXVj82O/YFSDLxJJvQ/tYL4m5rSevN1rDyE4b63PXXDj9Q4Mr9ywGOtnepeOo qSUuH0yiSuBxxEPogz4XeF+k1EB/bUZhUs4cPklqPdiIN+nXHVKdc1qdywvLPwBKLXOQ1Z gdd7hD9Ahv69RRDB8p0Ubdb62c9mo5c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4O/ZYs/He7pfI6AUNXbDMCwWsBjBwN7YH7BvPFY86sk=; b=QjTiXAo6CELLoOYAqii3wCFar/jl/OCHZ46h/yDEfxV/czuNR0cJdyyU6NQBM/eUsxVNFy QW8PRf0zYW99e9Dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4O/ZYs/He7pfI6AUNXbDMCwWsBjBwN7YH7BvPFY86sk=; b=ykBMsk8D6HXVj82O/YFSDLxJJvQ/tYL4m5rSevN1rDyE4b63PXXDj9Q4Mr9ywGOtnepeOo qSUuH0yiSuBxxEPogz4XeF+k1EB/bUZhUs4cPklqPdiIN+nXHVKdc1qdywvLPwBKLXOQ1Z gdd7hD9Ahv69RRDB8p0Ubdb62c9mo5c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4O/ZYs/He7pfI6AUNXbDMCwWsBjBwN7YH7BvPFY86sk=; b=QjTiXAo6CELLoOYAqii3wCFar/jl/OCHZ46h/yDEfxV/czuNR0cJdyyU6NQBM/eUsxVNFy QW8PRf0zYW99e9Dw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 734FF13A41; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id sIClGh6nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:58 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 04/29] ALSA: als300: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:15 +0100 Message-Id: <20240207155140.18238-5-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ykBMsk8D; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=QjTiXAo6 X-Spamd-Result: default: False [4.61 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.08)[63.34%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.61 X-Rspamd-Queue-Id: 9132522309 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/als300.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/pci/als300.c b/sound/pci/als300.c index c70aff060120..c7c481203ef8 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -654,7 +654,6 @@ static int snd_als300_create(struct snd_card *card, return 0; } -#ifdef CONFIG_PM_SLEEP static int snd_als300_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -677,11 +676,7 @@ static int snd_als300_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_als300_pm, snd_als300_suspend, snd_als300_resume); -#define SND_ALS300_PM_OPS &snd_als300_pm -#else -#define SND_ALS300_PM_OPS NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(snd_als300_pm, snd_als300_suspend, snd_als300_resume); static int snd_als300_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) @@ -739,7 +734,7 @@ static struct pci_driver als300_driver = { .id_table = snd_als300_ids, .probe = snd_als300_probe, .driver = { - .pm = SND_ALS300_PM_OPS, + .pm = &snd_als300_pm, }, }; From patchwork Wed Feb 7 15:51:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548665 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6347080027 for ; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; cv=none; b=DlbA/bj86hWNKXT8CkTrMqWzOrfhGyhvBmwNsEC0OWMAGQvWIIZIZdHuzssEimra9DAwDhgd/KA5oJKxSkULoYdNHDpnyH1trCjPx8mkCopOVvy/iixDrlAcEqclOk19hNp2uqWl7xA1oxgABIoJ3qDv+gRMnac0PCrtEK+Q07k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; c=relaxed/simple; bh=QBjR7zL3zkjrgba6HruXpg6Cx60pNzlJj+MbMtehyzQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oVDgIoXG3VOWht6ORjakLODGPlAyvEzVAA6DPeKGauS+U4Qgor9jQPmPKVc/ZXVtTvZ1hAZdgcvoY8H7GNZ9bmUDfDgyXBsep0zMGKVdzdiKoRy+UaEBrln0B8PZmnDwDeqKeJToubIclWh7q/1ZnTRgDwNzxFt/1BzOZ87v+94= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KEczlGdE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3/Tzwbz9; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KEczlGdE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3/Tzwbz9; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KEczlGdE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3/Tzwbz9"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KEczlGdE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3/Tzwbz9" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B7DBC1FBFB; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=In03LCVvKjdVVnOZxRHqmTh/otU4C0vSFFDZP/9P3ZU=; b=KEczlGdEBIQLzR/bmQZgfouxGONmnm7HSdu7xO0TjTHC8ZhYGsx7T5TObHDs/NFzvZV+a1 XC0N9rk0df9ntjQon7XnF6faUIun5snOT7rqMYrgUOTb7ZmbR8NXwJ/zx8Kim3MYBvB/yZ 3jEcuOcKhNAnFdtHYgFrzlHdPuzD3jc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=In03LCVvKjdVVnOZxRHqmTh/otU4C0vSFFDZP/9P3ZU=; b=3/Tzwbz9Sp2mjc542LpZOaGLdeUsntWQbh7I+rX+2ljR6sKTDK75M+1hOMuXAnQqYxSSil 1Ujo4BFrWbFiPnBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=In03LCVvKjdVVnOZxRHqmTh/otU4C0vSFFDZP/9P3ZU=; b=KEczlGdEBIQLzR/bmQZgfouxGONmnm7HSdu7xO0TjTHC8ZhYGsx7T5TObHDs/NFzvZV+a1 XC0N9rk0df9ntjQon7XnF6faUIun5snOT7rqMYrgUOTb7ZmbR8NXwJ/zx8Kim3MYBvB/yZ 3jEcuOcKhNAnFdtHYgFrzlHdPuzD3jc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=In03LCVvKjdVVnOZxRHqmTh/otU4C0vSFFDZP/9P3ZU=; b=3/Tzwbz9Sp2mjc542LpZOaGLdeUsntWQbh7I+rX+2ljR6sKTDK75M+1hOMuXAnQqYxSSil 1Ujo4BFrWbFiPnBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 98B53139B9; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id KJjQIx6nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:58 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 05/29] ALSA: als4000: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:16 +0100 Message-Id: <20240207155140.18238-6-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.69 X-Spamd-Result: default: False [3.69 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[51.22%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. For building properly, add the dummy functions for snd_sbmixer_suspend/resume() functions, too. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- include/sound/sb.h | 3 +++ sound/pci/als4000.c | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/sound/sb.h b/include/sound/sb.h index f540339fb0c7..24970f36c38a 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h @@ -290,6 +290,9 @@ int snd_sbmixer_new(struct snd_sb *chip); #ifdef CONFIG_PM void snd_sbmixer_suspend(struct snd_sb *chip); void snd_sbmixer_resume(struct snd_sb *chip); +#else +static inline void snd_sbmixer_suspend(struct snd_sb *chip) {} +static inline void snd_sbmixer_resume(struct snd_sb *chip) {} #endif /* sb8_init.c */ diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index f33aeb692a11..022473594c73 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c @@ -936,7 +936,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci, return snd_card_free_on_error(&pci->dev, __snd_card_als4000_probe(pci, pci_id)); } -#ifdef CONFIG_PM_SLEEP static int snd_als4000_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -968,18 +967,14 @@ static int snd_als4000_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume); -#define SND_ALS4000_PM_OPS &snd_als4000_pm -#else -#define SND_ALS4000_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume); static struct pci_driver als4000_driver = { .name = KBUILD_MODNAME, .id_table = snd_als4000_ids, .probe = snd_card_als4000_probe, .driver = { - .pm = SND_ALS4000_PM_OPS, + .pm = &snd_als4000_pm, }, }; From patchwork Wed Feb 7 15:51:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548667 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAEC87FBBE for ; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; cv=none; b=pHKDg9dqd8eH0ZbSb+NbhiRwXwd6d6OhtyG3xSzjBwaN2uo7kVC7mMzbw0LyIX8yi/hXmhnJ5wb2NeCCYVB75H7+wN+LMsCmbizFBGCLGbWJJEFqXAfn3LfnfxpmrQqK1cJQAC1JNcxROoYx8afFyyDQ71l1/3mrvhh5pcq87MM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; c=relaxed/simple; bh=f453AFvgy2SPgfF+h6VLKnsQfN2YtxEVzflcQD8tOPk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tih0MF5p6ATtz0UpyAvU9Zo/wplRoi4/7kPJFp2ueKQtINU/glMaYMGSllk//dN3lksA8dP9kxu9ZaQppEXVKB+fvCvoww3nBZGoyvrtDGVSxfyy77knZzFiyQtEgwVi1nlLY9bXrQjMf9VRk16XM2Q8kSKPNbI3tnDL+GFMu0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VpABIs4B; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=xYqriqWM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VpABIs4B; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=xYqriqWM; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VpABIs4B"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="xYqriqWM"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VpABIs4B"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="xYqriqWM" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DC5341FC07; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rG4RscVuKNFtfrHXTdl91jAByKplJdh4erLMdpvoRSI=; b=VpABIs4B2iF7FX4HSfpqySQNYdHi77UdkPgxJoEa7EYNwH2EKkXJSriPrtN/nRQH+69ZUk Lh9MX7XQAOK/q6ueuzgETdKNXqnYpSa/ONhjeF3V4ZgMSyiHUdoV5Cu2CjgQ7h5TTV7AL3 GPyGE62AZNuCiCRyKegQA38pouAXo70= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rG4RscVuKNFtfrHXTdl91jAByKplJdh4erLMdpvoRSI=; b=xYqriqWMOkhXjEvcPyz+TyGtepxEVbyvx8S2HqgLwiDdyt/szHSd5mCbYrHZ+RY9CEGtIT qRYrw3GGNDjcbiBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rG4RscVuKNFtfrHXTdl91jAByKplJdh4erLMdpvoRSI=; b=VpABIs4B2iF7FX4HSfpqySQNYdHi77UdkPgxJoEa7EYNwH2EKkXJSriPrtN/nRQH+69ZUk Lh9MX7XQAOK/q6ueuzgETdKNXqnYpSa/ONhjeF3V4ZgMSyiHUdoV5Cu2CjgQ7h5TTV7AL3 GPyGE62AZNuCiCRyKegQA38pouAXo70= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321118; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rG4RscVuKNFtfrHXTdl91jAByKplJdh4erLMdpvoRSI=; b=xYqriqWMOkhXjEvcPyz+TyGtepxEVbyvx8S2HqgLwiDdyt/szHSd5mCbYrHZ+RY9CEGtIT qRYrw3GGNDjcbiBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BFCA5139D8; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id QCBULR6nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:58 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 06/29] ALSA: atiixp: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:17 +0100 Message-Id: <20240207155140.18238-7-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=VpABIs4B; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xYqriqWM X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[26.40%] X-Spam-Score: -0.01 X-Rspamd-Queue-Id: DC5341FC07 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/atiixp.c | 12 ++---------- sound/pci/atiixp_modem.c | 11 ++--------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 43d01f1847ed..df2fef726d60 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -520,7 +520,6 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip) return 0; } -#ifdef CONFIG_PM_SLEEP static int snd_atiixp_aclink_down(struct atiixp *chip) { // if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */ @@ -530,7 +529,6 @@ static int snd_atiixp_aclink_down(struct atiixp *chip) ATI_REG_CMD_POWERDOWN); return 0; } -#endif /* * auto-detection of codecs @@ -1454,7 +1452,6 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock, } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -1499,12 +1496,7 @@ static int snd_atiixp_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); -#define SND_ATIIXP_PM_OPS &snd_atiixp_pm -#else -#define SND_ATIIXP_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ - +static DEFINE_SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); /* * proc interface for register dump @@ -1634,7 +1626,7 @@ static struct pci_driver atiixp_driver = { .id_table = snd_atiixp_ids, .probe = snd_atiixp_probe, .driver = { - .pm = SND_ATIIXP_PM_OPS, + .pm = &snd_atiixp_pm, }, }; diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 8864c4c3c7e1..eb569539f322 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -496,7 +496,6 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip) return 0; } -#ifdef CONFIG_PM_SLEEP static int snd_atiixp_aclink_down(struct atiixp_modem *chip) { // if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */ @@ -506,7 +505,6 @@ static int snd_atiixp_aclink_down(struct atiixp_modem *chip) ATI_REG_CMD_POWERDOWN); return 0; } -#endif /* * auto-detection of codecs @@ -1094,7 +1092,6 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock) } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -1128,11 +1125,7 @@ static int snd_atiixp_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); -#define SND_ATIIXP_PM_OPS &snd_atiixp_pm -#else -#define SND_ATIIXP_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); /* * proc interface for register dump @@ -1258,7 +1251,7 @@ static struct pci_driver atiixp_modem_driver = { .id_table = snd_atiixp_ids, .probe = snd_atiixp_probe, .driver = { - .pm = SND_ATIIXP_PM_OPS, + .pm = &snd_atiixp_pm, }, }; From patchwork Wed Feb 7 15:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548668 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC59680032 for ; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; cv=none; b=BMdfIV3ilPqzIPRUXn19oZ0uveHIlbvI8g96fTpWfdHBYRThwUpfuxbulo082+tH3OmbRgcTvLQv2heTIEm90oE6RtgVh0oN/YTfyaeSLpPmZRPuqqps76bdHSepiHPdXSZl1jJzVq5XI+Gx+p5gDhWVvD9HE8GjCs/Vkb1xXu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321122; c=relaxed/simple; bh=suTSG/dbWKYnEU9XeJ8a7XBHsIicW4CmlW1q6Wraiog=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZVYES7TVj0uggvVMhDVuB+zmSE0yI/hjJ9uFpXw+ko/5lWjYpsD4r1/PRh883m/iFaXls8e+tTEfBU4yEzriHZ+vWPfNz9HGTUlBitRWsIE1R5y637L64p033jYtlIIKHsK4SzPquEDZNW96Izi7TMYt3leVSnpVyP96+W5SaKk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=MoPfLlFl; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=f8Zwoibb; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=MoPfLlFl; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=f8Zwoibb; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MoPfLlFl"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="f8Zwoibb"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MoPfLlFl"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="f8Zwoibb" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0DA3922330; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/N2qFa1jWdoTGrVKVWyK/iNILxA4QtZ77MGOkz6cMI=; b=MoPfLlFlq/PdYUFBbA9T31hY2k7l3VGrLurOqb6MCz30MiyvROyQqfU2osHnZN7bPX1BNl YfBuogqkpGQtLM20cfKmjFyz0nTQ5x63e1IGKfSwpgaGTAbqdvjmbhe37wP4ezPmToOFr8 7Ym0qaaNXcBvDrxTi9ggpQxwftjUmFo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/N2qFa1jWdoTGrVKVWyK/iNILxA4QtZ77MGOkz6cMI=; b=f8ZwoibbZvg0ho7YEoq3BLX0di5UGynYMqqBEj9TnVYohnk1J/azH3Rkh+mKz9VNBPvSSB L/rIFbWZko92r7CQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/N2qFa1jWdoTGrVKVWyK/iNILxA4QtZ77MGOkz6cMI=; b=MoPfLlFlq/PdYUFBbA9T31hY2k7l3VGrLurOqb6MCz30MiyvROyQqfU2osHnZN7bPX1BNl YfBuogqkpGQtLM20cfKmjFyz0nTQ5x63e1IGKfSwpgaGTAbqdvjmbhe37wP4ezPmToOFr8 7Ym0qaaNXcBvDrxTi9ggpQxwftjUmFo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/N2qFa1jWdoTGrVKVWyK/iNILxA4QtZ77MGOkz6cMI=; b=f8ZwoibbZvg0ho7YEoq3BLX0di5UGynYMqqBEj9TnVYohnk1J/azH3Rkh+mKz9VNBPvSSB L/rIFbWZko92r7CQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E4FFF139B9; Wed, 7 Feb 2024 15:51:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4N5pNh6nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:58 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 07/29] ALSA: ens137x: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:18 +0100 Message-Id: <20240207155140.18238-8-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[33.52%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. For building properly, add the dummy functions for snd_ak4531_suspend/resume() functions, too. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- include/sound/ak4531_codec.h | 3 +++ sound/pci/ens1370.c | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h index 9a4429970d92..64402347d7a2 100644 --- a/include/sound/ak4531_codec.h +++ b/include/sound/ak4531_codec.h @@ -65,6 +65,9 @@ int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531, #ifdef CONFIG_PM void snd_ak4531_suspend(struct snd_ak4531 *ak4531); void snd_ak4531_resume(struct snd_ak4531 *ak4531); +#else +static inline void snd_ak4531_suspend(struct snd_ak4531 *ak4531) {} +static inline void snd_ak4531_resume(struct snd_ak4531 *ak4531) {} #endif #endif /* __SOUND_AK4531_CODEC_H */ diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 89210b2c7342..18928b905939 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -1968,7 +1968,6 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq) outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); } -#ifdef CONFIG_PM_SLEEP static int snd_ensoniq_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -2007,11 +2006,7 @@ static int snd_ensoniq_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume); -#define SND_ENSONIQ_PM_OPS &snd_ensoniq_pm -#else -#define SND_ENSONIQ_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume); static int snd_ensoniq_create(struct snd_card *card, struct pci_dev *pci) @@ -2380,7 +2375,7 @@ static struct pci_driver ens137x_driver = { .id_table = snd_audiopci_ids, .probe = snd_audiopci_probe, .driver = { - .pm = SND_ENSONIQ_PM_OPS, + .pm = &snd_ensoniq_pm, }, }; From patchwork Wed Feb 7 15:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548670 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3D0A80034 for ; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321123; cv=none; b=hzjxL3rwyTAp4x1eoODkPUsxVZXWXtjhP4eQ8Ct2Y7Zk9br9BO0BWIp+KkQ8ZAZadqegpiT6ZNk9WTETVtuBF7B1SVhLn+7FEfd05fCCRGfyf5tsUpUZCLd5yd4eOYJsMZn9MmRXA4+8TSWYGQBLqg8lNgXjvC4OQ1m+b//rwfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321123; c=relaxed/simple; bh=xQlriAHKLDtcjyjluVuwcZjNxisuyY2MER5fZnpqKk4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NyGPNxZxpJ3cbmMElD4zuPu8K47/S43+EWlQItBC8ypP2vdqlxOZWUqy+jMuf2YMLOfr5z+udngQ8olPtBJjh8/GOkZuOsXjpMM2PmJbI8RBWpDOUFfY4E+m+NtpjUpljBvJAzutIimilfN7XoIpDs8DjUh5Ah+WfRvpMMxZKx8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Pudm7jvJ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=tZ71l25M; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Pudm7jvJ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=tZ71l25M; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Pudm7jvJ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tZ71l25M"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Pudm7jvJ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tZ71l25M" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 34AB42233C; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbSLsh/ddHLZoH/PhuVGVKkIucz0essSka/S5+dSdrQ=; b=Pudm7jvJbJrTyozx+uhit3IbDLWij5BC5Ya/+usfIsYQoR1vRmANnCOvG/Z3dUcXqT77lU 6fPuLHGwvuyn14WvFuQzSYF4dcLNBvsfueeP81dMhm29tjvtLaq0AML9SyTwNR4hOvHE1y I5EadSM6riVk/OuaM+oi9Ndr+qru+Hk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbSLsh/ddHLZoH/PhuVGVKkIucz0essSka/S5+dSdrQ=; b=tZ71l25M9Z3Nf2kArmpe6cYFF5/cNqWqfma95ELX8jsW4mHwMU7HmsnifYR0T/0qd8d1ya Lxt8QzOOBfBknxDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbSLsh/ddHLZoH/PhuVGVKkIucz0essSka/S5+dSdrQ=; b=Pudm7jvJbJrTyozx+uhit3IbDLWij5BC5Ya/+usfIsYQoR1vRmANnCOvG/Z3dUcXqT77lU 6fPuLHGwvuyn14WvFuQzSYF4dcLNBvsfueeP81dMhm29tjvtLaq0AML9SyTwNR4hOvHE1y I5EadSM6riVk/OuaM+oi9Ndr+qru+Hk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbSLsh/ddHLZoH/PhuVGVKkIucz0essSka/S5+dSdrQ=; b=tZ71l25M9Z3Nf2kArmpe6cYFF5/cNqWqfma95ELX8jsW4mHwMU7HmsnifYR0T/0qd8d1ya Lxt8QzOOBfBknxDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 17AD4139D8; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id YAwNBB+nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:59 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 08/29] ALSA: intel8x0: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:19 +0100 Message-Id: <20240207155140.18238-9-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 9 ++------- sound/pci/intel8x0m.c | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index ae285c0a629c..dae3e15ba534 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2555,7 +2555,6 @@ static void snd_intel8x0_free(struct snd_card *card) free_irq(chip->irq, chip); } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -2628,11 +2627,7 @@ static int intel8x0_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume); -#define INTEL8X0_PM_OPS &intel8x0_pm -#else -#define INTEL8X0_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume); #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ @@ -3200,7 +3195,7 @@ static struct pci_driver intel8x0_driver = { .id_table = snd_intel8x0_ids, .probe = snd_intel8x0_probe, .driver = { - .pm = INTEL8X0_PM_OPS, + .pm = &intel8x0_pm, }, }; diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 653ecca78238..3d6f5b3cc73e 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c @@ -965,7 +965,6 @@ static void snd_intel8x0m_free(struct snd_card *card) free_irq(chip->irq, chip); } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -1006,11 +1005,7 @@ static int intel8x0m_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(intel8x0m_pm, intel8x0m_suspend, intel8x0m_resume); -#define INTEL8X0M_PM_OPS &intel8x0m_pm -#else -#define INTEL8X0M_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(intel8x0m_pm, intel8x0m_suspend, intel8x0m_resume); static void snd_intel8x0m_proc_read(struct snd_info_entry * entry, struct snd_info_buffer *buffer) @@ -1236,7 +1231,7 @@ static struct pci_driver intel8x0m_driver = { .id_table = snd_intel8x0m_ids, .probe = snd_intel8x0m_probe, .driver = { - .pm = INTEL8X0M_PM_OPS, + .pm = &intel8x0m_pm, }, }; From patchwork Wed Feb 7 15:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548671 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5089980025 for ; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321124; cv=none; b=iwRRrBuuqUF6S00GHoTAfSfEfex8PhTuU/QIoEQN4UsXq4vIxre3xjABMxHOZc8C9eVbZRrxEq958Jk5Kn0hiMDxvfALs43RId6f5K2ks3LKvSy3SB0MiLOiS3XiPF342O+JlLgP4p8suUidRmbUqQS+9NyMukXQMId1PIPulpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321124; c=relaxed/simple; bh=nN5xSet/mxw1jzwFhD1eVSiPXdl2wvuSLudaWsxeblU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HShu9Mq3ocdfBbZxwOBjRDZlM7vaj3AYWmANG43ctCO1D3OhiCDsD9uREChDXK/wz49UYMKRgkoDKTHsPSmFU7CP3hUH55D0HR2Q5bS50Ynh4utFvNV+kzxC1XVpFIXmmz5jbaS63HzY0wBzmis/30nZOITb6Lu+LOnhYHcxceU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=jdRZtcSu; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=EYUq0Cqt; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=jdRZtcSu; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=EYUq0Cqt; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="jdRZtcSu"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="EYUq0Cqt"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="jdRZtcSu"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="EYUq0Cqt" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5CF2B2230B; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+h3uA8cduOd0NSKXWsTooK2h9e9BzwvV0ecxYOV5SY=; b=jdRZtcSurrgPNNR0AmHyjtKncgdCTsOoQLt74sqBRxWO5RqKGY18kiIPoi7BAQtXKM1YOj 5tWku6DoJPqeDF3bkbYqA/iUfKUmRpVe0/DkYERpPapcF7evAjCpKOoLCjeJz53d4fmGNK xeQKMYhEb25ALW6YXQjbvT9BCIiXBQc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+h3uA8cduOd0NSKXWsTooK2h9e9BzwvV0ecxYOV5SY=; b=EYUq0CqtI8Mt8o2xU1ByNOyIC0wSQxZsOGKu3YBGZ9SoaGDykhSyeIQ+ZHDffdaC9um+mM Aom0pbSZM2ayXkCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+h3uA8cduOd0NSKXWsTooK2h9e9BzwvV0ecxYOV5SY=; b=jdRZtcSurrgPNNR0AmHyjtKncgdCTsOoQLt74sqBRxWO5RqKGY18kiIPoi7BAQtXKM1YOj 5tWku6DoJPqeDF3bkbYqA/iUfKUmRpVe0/DkYERpPapcF7evAjCpKOoLCjeJz53d4fmGNK xeQKMYhEb25ALW6YXQjbvT9BCIiXBQc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+h3uA8cduOd0NSKXWsTooK2h9e9BzwvV0ecxYOV5SY=; b=EYUq0CqtI8Mt8o2xU1ByNOyIC0wSQxZsOGKu3YBGZ9SoaGDykhSyeIQ+ZHDffdaC9um+mM Aom0pbSZM2ayXkCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3E45B139B9; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id CJjKDR+nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:59 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 09/29] ALSA: nm256: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:20 +0100 Message-Id: <20240207155140.18238-10-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=jdRZtcSu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=EYUq0Cqt X-Spamd-Result: default: False [4.48 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.21)[71.70%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.48 X-Rspamd-Queue-Id: 5CF2B2230B X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/nm256/nm256.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 34f90829e656..11ba7d4eac2a 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1356,7 +1356,6 @@ snd_nm256_peek_for_sig(struct nm256 *chip) return 0; } -#ifdef CONFIG_PM_SLEEP /* * APM event handler, so the card is properly reinitialized after a power * event. @@ -1400,11 +1399,7 @@ static int nm256_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume); -#define NM256_PM_OPS &nm256_pm -#else -#define NM256_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume); static void snd_nm256_free(struct snd_card *card) { @@ -1660,7 +1655,7 @@ static struct pci_driver nm256_driver = { .id_table = snd_nm256_ids, .probe = snd_nm256_probe, .driver = { - .pm = NM256_PM_OPS, + .pm = &nm256_pm, }, }; From patchwork Wed Feb 7 15:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548669 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C12C7E775 for ; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321123; cv=none; b=EAC08fn1CEVRYNDbvR+Dcuf7L0tO1AbKM8zcsAs13JPwbxeXdtTmey/5vuz2b9oJlAl+PIq1CFKOIKjJ9XkRvNBuS0dRc08yiznlv2CXgN1NZNde592E6U8lDVC3z80yvoXCGcT06bGD4XfKCUrPBbEwhFRO5BmrHibsiZ9ju3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321123; c=relaxed/simple; bh=aesraOsiJTvlpBpgSIEzmFW/aaH8s6B+4242eN/6wbA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HJeItox2kR1cYv5fbc440YfFMj96NZrqAuMnL8gIhM3i4iKKUJuTaOFCkEqCdFE4rUzHDL+G3w/nVGuIlGYMHsnAPzDlNuyGN1nGbc8UuKGM1Oq1qkhYiBAO1Jw1sC2DtV/r+lMGb/S+RBxL7rKRnHmY8ODgPuPYJYiqwuX4nBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=XFKyL+ce; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=LnEyqVNk; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=XFKyL+ce; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=LnEyqVNk; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="XFKyL+ce"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="LnEyqVNk"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="XFKyL+ce"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="LnEyqVNk" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 82C681FC2A; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C/tT5aabcSrmTAs7ZFmkhG3GeXQDSk1ej4tU7HQtXdQ=; b=XFKyL+ce9FK5nrILsKVIYBNDf1pLvkFBGuVkCMsQ6/4MqVBHKuajTyoyhF2bsXEzG9SqwK GWx/c7FvfQ139ZenfBZ4UIe6bH5OaLveSWG8yZrLqoexG6ctcK7W3NZq9LR2nx+khNjTHX /FHSp79Or4d9zKpn929Ml+oxm/BvoYg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C/tT5aabcSrmTAs7ZFmkhG3GeXQDSk1ej4tU7HQtXdQ=; b=LnEyqVNks3jWrx0OdTbuUqh++va4r3ceRfXw85kVkwo01ZSNOYA5ONFytWSt6AsSd1jL8y DTefTkqFjUID3PBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C/tT5aabcSrmTAs7ZFmkhG3GeXQDSk1ej4tU7HQtXdQ=; b=XFKyL+ce9FK5nrILsKVIYBNDf1pLvkFBGuVkCMsQ6/4MqVBHKuajTyoyhF2bsXEzG9SqwK GWx/c7FvfQ139ZenfBZ4UIe6bH5OaLveSWG8yZrLqoexG6ctcK7W3NZq9LR2nx+khNjTHX /FHSp79Or4d9zKpn929Ml+oxm/BvoYg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C/tT5aabcSrmTAs7ZFmkhG3GeXQDSk1ej4tU7HQtXdQ=; b=LnEyqVNks3jWrx0OdTbuUqh++va4r3ceRfXw85kVkwo01ZSNOYA5ONFytWSt6AsSd1jL8y DTefTkqFjUID3PBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 655B1139D8; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id ICIkFx+nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:59 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 10/29] ALSA: aoa: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:21 +0100 Message-Id: <20240207155140.18238-11-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.26 X-Spamd-Result: default: False [3.26 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.44)[78.61%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/aoa/fabrics/layout.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 0cd19a05db19..e68b4cb4df29 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -1126,7 +1126,6 @@ static void aoa_fabric_layout_remove(struct soundbus_dev *sdev) sdev->pcmname = NULL; } -#ifdef CONFIG_PM_SLEEP static int aoa_fabric_layout_suspend(struct device *dev) { struct layout_dev *ldev = dev_get_drvdata(dev); @@ -1147,11 +1146,9 @@ static int aoa_fabric_layout_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(aoa_fabric_layout_pm_ops, +static DEFINE_SIMPLE_DEV_PM_OPS(aoa_fabric_layout_pm_ops, aoa_fabric_layout_suspend, aoa_fabric_layout_resume); -#endif - static struct soundbus_driver aoa_soundbus_driver = { .name = "snd_aoa_soundbus_drv", .owner = THIS_MODULE, @@ -1159,9 +1156,7 @@ static struct soundbus_driver aoa_soundbus_driver = { .remove = aoa_fabric_layout_remove, .driver = { .owner = THIS_MODULE, -#ifdef CONFIG_PM_SLEEP .pm = &aoa_fabric_layout_pm_ops, -#endif } }; From patchwork Wed Feb 7 15:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548674 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80245811E1 for ; Wed, 7 Feb 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321128; cv=none; b=Gy5HGUATEs/HyDW6xH1g7WrLAAUAZl8Qf4l38riEQQSsT1onlmxgUD/jiNIMWVHZoechNQT7SGO3gvqR9o8E2EFJxsyOBeJjJP3YvbL6LV3K2F2ZuMUzuOhAdzSSSOfSt0VmeXmKOTD9nAIyBrSdvxvyn0McKGjwxsU4YIlcrS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321128; c=relaxed/simple; bh=j1ptuY6qE3DOvTce0gVq9GKOliHGZVv99FvLPys5Bog=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JlsGT9rNc4VxR2TCUJxaegJ98xRddk44+axyDYpp5sSc882X8zECtWNgbRYHwT2gcjBAcYH6oSkqdDnYEiUP2xPGPwPo/Jh8+Y6PYpikfr4gZXfZKuqspsthl8CbcHzFcMi9ZYgkW9eucwsQfILOBOwgk8vBFFyTPi9z7Afc6Ko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=w27hfbM1; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uQN2FlFD; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=w27hfbM1; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uQN2FlFD; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="w27hfbM1"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uQN2FlFD"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="w27hfbM1"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uQN2FlFD" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B62211FC05; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAH6w+jueA1aMMi9kxElZuC5v/K2lcpicg/es/nZfLc=; b=w27hfbM1qW+05IQIk3Xq7BeF5OK4060+TvWNcTSYLG3Q0y0E6S764NgASz52l3ZZvH41Fv 7sgATGtnI1168lF21rwa0F5Uc6fbRKBtv8fUo7PEK5GDarihztd/aqNpZNBkqqjniyAGd8 7YrLclNkyRK0B+bNWy2/I/vIP76fodE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAH6w+jueA1aMMi9kxElZuC5v/K2lcpicg/es/nZfLc=; b=uQN2FlFDw/lK15HTT8xQq8i6Q+mRM64AmFyPZMYZ+RZzb270VsBFQ/KRFts9LbJQYMo7xg t1G24+1MKqa+FwAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAH6w+jueA1aMMi9kxElZuC5v/K2lcpicg/es/nZfLc=; b=w27hfbM1qW+05IQIk3Xq7BeF5OK4060+TvWNcTSYLG3Q0y0E6S764NgASz52l3ZZvH41Fv 7sgATGtnI1168lF21rwa0F5Uc6fbRKBtv8fUo7PEK5GDarihztd/aqNpZNBkqqjniyAGd8 7YrLclNkyRK0B+bNWy2/I/vIP76fodE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAH6w+jueA1aMMi9kxElZuC5v/K2lcpicg/es/nZfLc=; b=uQN2FlFDw/lK15HTT8xQq8i6Q+mRM64AmFyPZMYZ+RZzb270VsBFQ/KRFts9LbJQYMo7xg t1G24+1MKqa+FwAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8B8BE139B9; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id qBaFIB+nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:59 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 11/29] ALSA: aaci: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:22 +0100 Message-Id: <20240207155140.18238-12-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[38.94%] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 0817ad21af74..f64896564728 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -737,7 +737,6 @@ static const struct snd_pcm_ops aaci_capture_ops = { /* * Power Management. */ -#ifdef CONFIG_PM static int aaci_do_suspend(struct snd_card *card) { struct aaci *aaci = card->private_data; @@ -763,12 +762,7 @@ static int aaci_resume(struct device *dev) return card ? aaci_do_resume(card) : 0; } -static SIMPLE_DEV_PM_OPS(aaci_dev_pm_ops, aaci_suspend, aaci_resume); -#define AACI_DEV_PM_OPS (&aaci_dev_pm_ops) -#else -#define AACI_DEV_PM_OPS NULL -#endif - +static DEFINE_SIMPLE_DEV_PM_OPS(aaci_dev_pm_ops, aaci_suspend, aaci_resume); static const struct ac97_pcm ac97_defs[] = { [0] = { /* Front PCM */ @@ -1081,7 +1075,7 @@ MODULE_DEVICE_TABLE(amba, aaci_ids); static struct amba_driver aaci_driver = { .drv = { .name = DRIVER_NAME, - .pm = AACI_DEV_PM_OPS, + .pm = &aaci_dev_pm_ops, }, .probe = aaci_probe, .remove = aaci_remove, From patchwork Wed Feb 7 15:51:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548673 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A46B78062C for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321127; cv=none; b=UqmtmgNlxLhSLgsX146i7T41KmFeunMoAPz4DvAERQoyQXRhFgyAByLi5fY+sPYvAqwKRiV+dTQvLT5qm/C1qGz0mC3ugFskPOEPYtdEpXKHBeO4yRzdAaHGEblTRjEF42sOypXvScDwIB9Qcbd38fDoHcHGFXqxlMXB1+5fC80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321127; c=relaxed/simple; bh=Gne44qrVhHXAX5RmHYmk5R64Li35Czrhbs4lYrsStHY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MdBbSfAx9UNeELtrtI/4yiyBz8J+zVNSMdp+ZMiqtAyz92qCTnAVnoHSznn7MZfXKy70KBJ55FYZevUPeWKXJ4Pu71SgEFr2+5/GLIpQf7n4AoGrvO8eJqtz5TOql6NgFw2oeNwV50r6DEETWbH5rawIY7v4Kw2Ur+8xayr8qLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=gwcIqr7e; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=08XkPRuk; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=gwcIqr7e; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=08XkPRuk; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gwcIqr7e"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="08XkPRuk"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gwcIqr7e"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="08XkPRuk" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DBD4D1FC0B; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oel3zzvaGFB2WiIFAvLM4ItKH2OAwN8f+65LQ3YxBMY=; b=gwcIqr7eMue1ZlxG+MQKk15y+XEPxaLjD4XCRPBgokhQAgUwFW1iz7S8RU369iomZIGNZX JBqmZpCVLyHDqn3tAHHMjKHtAJyMzK59023Wz7fKLa0OO+elHIIQW6hhmq4lwTFO6oVMIO zAp9vVLaSrQIQBS3OyJxeRr8PRuDsSo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oel3zzvaGFB2WiIFAvLM4ItKH2OAwN8f+65LQ3YxBMY=; b=08XkPRuk33WF8QxUDCIrmb5cWst+rarKuPNVQyXyrt9PEcayZYBo6D+7STd5gpUo7ppXUM 9fXbItOzTc9drpCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oel3zzvaGFB2WiIFAvLM4ItKH2OAwN8f+65LQ3YxBMY=; b=gwcIqr7eMue1ZlxG+MQKk15y+XEPxaLjD4XCRPBgokhQAgUwFW1iz7S8RU369iomZIGNZX JBqmZpCVLyHDqn3tAHHMjKHtAJyMzK59023Wz7fKLa0OO+elHIIQW6hhmq4lwTFO6oVMIO zAp9vVLaSrQIQBS3OyJxeRr8PRuDsSo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321119; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oel3zzvaGFB2WiIFAvLM4ItKH2OAwN8f+65LQ3YxBMY=; b=08XkPRuk33WF8QxUDCIrmb5cWst+rarKuPNVQyXyrt9PEcayZYBo6D+7STd5gpUo7ppXUM 9fXbItOzTc9drpCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B69A1139D8; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id OFULKx+nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:59 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 12/29] ALSA: pxa2xx-ac97: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:23 +0100 Message-Id: <20240207155140.18238-13-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=gwcIqr7e; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=08XkPRuk X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.15 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.14)[68.20%] X-Spam-Score: -0.15 X-Rspamd-Queue-Id: DBD4D1FC0B X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/arm/pxa2xx-ac97.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 2d83ad91f968..4c367e73b2c9 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -111,8 +111,6 @@ static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream) return snd_ac97_set_rate(pxa2xx_ac97_ac97, reg, runtime->rate); } -#ifdef CONFIG_PM_SLEEP - static int pxa2xx_ac97_do_suspend(struct snd_card *card) { pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; @@ -164,8 +162,7 @@ static int pxa2xx_ac97_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume); -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume); static const struct snd_pcm_ops pxa2xx_ac97_pcm_ops = { .open = pxa2xx_ac97_pcm_open, @@ -277,9 +274,7 @@ static struct platform_driver pxa2xx_ac97_driver = { .remove_new = pxa2xx_ac97_remove, .driver = { .name = "pxa2xx-ac97", -#ifdef CONFIG_PM_SLEEP .pm = &pxa2xx_ac97_pm_ops, -#endif }, }; From patchwork Wed Feb 7 15:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548690 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3406C8063F for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; cv=none; b=ScALfru7mhVabFiijdjWj54VFY2H4Ottt2e1bdc0u0yigDBsQqPmrWGXHQfyc9MN3v6mo9VdUoXL3C1E/NuFTFT6MqXbNCWDoFguT6i+jODlRjR+Kz1HnGtVxlvESVBqykccA14dMshac27cj4IFYqlOmWO09DwROcIiT+yoUds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; c=relaxed/simple; bh=EvRpMeQXqdrF9GHztUSN17/XpnSRBnq9+4Ikf+zduoc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IrqHvs7GOB5TeZ5FH2QuUpyhnOpRSVYLSVtZaoMlP/DIypCyU+6bV5qt8PJQy4T+F03Wye3XjhD0rB7ZAGe9y7Xif2t/WtjtYdTPlZZ9qftt1G5Io+i70yAIFNNn4WjHOIyKJvMa53nfEbtKxPyqxettCoONgvIHSTnV79iw768= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=n3xK1Otl; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=pLy2wCJI; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=n3xK1Otl; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=pLy2wCJI; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="n3xK1Otl"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="pLy2wCJI"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="n3xK1Otl"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="pLy2wCJI" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 151361FC0D; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+0zZ028hNzQmD1UXgkzgkxivVsFb7KPn9mZ4FtigkCA=; b=n3xK1OtlN+fUzHArFkk56RgReZV9hlp1eihaVfOu4ymGYfHVeSlJquX9V3iqbc8UPdicpc +OQTiKAEpmLz7q5QB3YHsCNUl28/UHFsJzVx7kFgJqkovU2Z58So7VJsT2NLS9ZAyFB5Ho 9xw0UPN+43W/mC+hYCNZfvlWuOEyPB0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+0zZ028hNzQmD1UXgkzgkxivVsFb7KPn9mZ4FtigkCA=; b=pLy2wCJItZ5F+xMSKv6vUw49v6Rti+c+XTMoA+twrbuU1s6PHTvj6Y1bX68iMYUu0HgLiu IgTH+EBeP/n7lzAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+0zZ028hNzQmD1UXgkzgkxivVsFb7KPn9mZ4FtigkCA=; b=n3xK1OtlN+fUzHArFkk56RgReZV9hlp1eihaVfOu4ymGYfHVeSlJquX9V3iqbc8UPdicpc +OQTiKAEpmLz7q5QB3YHsCNUl28/UHFsJzVx7kFgJqkovU2Z58So7VJsT2NLS9ZAyFB5Ho 9xw0UPN+43W/mC+hYCNZfvlWuOEyPB0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+0zZ028hNzQmD1UXgkzgkxivVsFb7KPn9mZ4FtigkCA=; b=pLy2wCJItZ5F+xMSKv6vUw49v6Rti+c+XTMoA+twrbuU1s6PHTvj6Y1bX68iMYUu0HgLiu IgTH+EBeP/n7lzAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E69F0139B9; Wed, 7 Feb 2024 15:51:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id yGzWNR+nw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:51:59 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 13/29] ASoC: pxa2xx-ac97: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:24 +0100 Message-Id: <20240207155140.18238-14-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[26.70%] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/soc/pxa/pxa2xx-ac97.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index e73bd62c033c..80e0ea0ec9fb 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -271,7 +271,6 @@ static void pxa2xx_ac97_dev_remove(struct platform_device *pdev) pxa2xx_ac97_hw_remove(pdev); } -#ifdef CONFIG_PM_SLEEP static int pxa2xx_ac97_dev_suspend(struct device *dev) { return pxa2xx_ac97_hw_suspend(); @@ -282,18 +281,15 @@ static int pxa2xx_ac97_dev_resume(struct device *dev) return pxa2xx_ac97_hw_resume(); } -static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, +static DEFINE_SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_dev_suspend, pxa2xx_ac97_dev_resume); -#endif static struct platform_driver pxa2xx_ac97_driver = { .probe = pxa2xx_ac97_dev_probe, .remove_new = pxa2xx_ac97_dev_remove, .driver = { .name = "pxa2xx-ac97", -#ifdef CONFIG_PM_SLEEP .pm = &pxa2xx_ac97_pm_ops, -#endif .of_match_table = of_match_ptr(pxa2xx_ac97_dt_ids), }, }; From patchwork Wed Feb 7 15:51:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548677 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A465F7E775 for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=ltRpXRl3XxufoLEj3U5SmN7XGmX3l1DjIi+hHIhu9BHHnm5+wsn6xH24qMvql6UzCzyrB5s03hPFhj6kiaOYZlcKnHo3aIKceFO8Lmm3/DGm++sDtD/vGJo7b2Zq92+INVOLrS8B7ZOvkSjKaKJtACl/I3K9fLqJgNQ7zYnPKo0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=qGBgcosL773euYEsR6tg32bUlmsUAzBmyyjM9u4F47Q=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SJqxSwLtue9Ja2pb/1iEi/Zgosnm2sUlrrfs9Fh6bokBTWlzGn1QqPEI31mfgDVom41vxMKvEghpS/KVbC6e+pPtX9m68+H+nU7M6vKXmJPDBAPK8KSqOFjgaMK1OF5tyvPTIbR4dtlPlSSTbL1YCkF3Ev4Ou4vZtVrcYjxFD+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TM+PUR35; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/wKMxDqY; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TM+PUR35; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/wKMxDqY; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TM+PUR35"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/wKMxDqY"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TM+PUR35"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/wKMxDqY" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3C8281FC11; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LEJOtvqlYMxSdlEpTisq40fisZwNeKl686SVSWaSjqs=; b=TM+PUR35SMyHVye8vjFu2eyq36Y0w4pFxggm+0hblge/tU7I+qmoao4JV1vqXnY0ptiEZc Q6w/uYHNkOpzYC60PHpReKYZtXc0pPlq9iv36vARCrfZemrCjo6zDAWeZ3IX5N+wJ1DKpG uyZR8CYT21qwlsP6k99RZopj/+bUa1Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LEJOtvqlYMxSdlEpTisq40fisZwNeKl686SVSWaSjqs=; b=/wKMxDqYN9zqiT1h5t+UQjz7yk1IwnDPNprOcr2l+PFfxFkNpjcz47L0202KdQxf6v+wuG rtVn0xUJB3IHg8CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LEJOtvqlYMxSdlEpTisq40fisZwNeKl686SVSWaSjqs=; b=TM+PUR35SMyHVye8vjFu2eyq36Y0w4pFxggm+0hblge/tU7I+qmoao4JV1vqXnY0ptiEZc Q6w/uYHNkOpzYC60PHpReKYZtXc0pPlq9iv36vARCrfZemrCjo6zDAWeZ3IX5N+wJ1DKpG uyZR8CYT21qwlsP6k99RZopj/+bUa1Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LEJOtvqlYMxSdlEpTisq40fisZwNeKl686SVSWaSjqs=; b=/wKMxDqYN9zqiT1h5t+UQjz7yk1IwnDPNprOcr2l+PFfxFkNpjcz47L0202KdQxf6v+wuG rtVn0xUJB3IHg8CA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1D808139D8; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0LGWBSCnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:00 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 14/29] ALSA: at73c213: Replace with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:25 +0100 Message-Id: <20240207155140.18238-15-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=TM+PUR35; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/wKMxDqY" X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.73 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.72)[83.64%] X-Spam-Score: -0.73 X-Rspamd-Queue-Id: 3C8281FC11 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai --- sound/spi/at73c213.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c index 1e8765d75d8f..5648d744aa79 100644 --- a/sound/spi/at73c213.c +++ b/sound/spi/at73c213.c @@ -1076,8 +1076,6 @@ static void snd_at73c213_remove(struct spi_device *spi) snd_card_free(card); } -#ifdef CONFIG_PM_SLEEP - static int snd_at73c213_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -1109,18 +1107,13 @@ static int snd_at73c213_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(at73c213_pm_ops, snd_at73c213_suspend, +static DEFINE_SIMPLE_DEV_PM_OPS(at73c213_pm_ops, snd_at73c213_suspend, snd_at73c213_resume); -#define AT73C213_PM_OPS (&at73c213_pm_ops) - -#else -#define AT73C213_PM_OPS NULL -#endif static struct spi_driver at73c213_driver = { .driver = { .name = "at73c213", - .pm = AT73C213_PM_OPS, + .pm = &at73c213_pm_ops, }, .probe = snd_at73c213_probe, .remove = snd_at73c213_remove, From patchwork Wed Feb 7 15:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548672 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A061A8062A for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321126; cv=none; b=BOqQ1/WxtQfMHrCCMFMPT2cLfpvPlL8NDyXbCUOCgDV/k4UGzKvkLsLu3AxEgfgn0dWDh3K1WOADBL86Cq4hNye7eIWWUJhKctPdhvBLscreR6l7Y9SxVMoiYc7yOVL1R9fmt6c9XZS3Enb/hKiv5nodwTF6+Xsy08Aa5TJFwhk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321126; c=relaxed/simple; bh=+3/t1QhnXi5LeQeL2vF3dXyf6lkogwW0uYp+iexHjVc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y/fkWmMBZdfcFfIBCQwnuvG2lEWoJi5b4tSxaHM7pTnXDfhbHrzfgKJ8IpD9DLoxUnwBBMAv2N/01g02zrk6Gz5r29ZDnhJJnU886PeG45iS/PY2fiinw+IC1ZhjydHNkGz4EJfp5gLZ+0vdIYLDOczGOOsWfpiYMr3YdfjB+m8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=dOeAO6pL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=7bSZ7F5M; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=dOeAO6pL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=7bSZ7F5M; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="dOeAO6pL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="7bSZ7F5M"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="dOeAO6pL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="7bSZ7F5M" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6448B2230F; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zznsNNFM1an/LPEUUyOSCoz1lrvKfb3yYqyo3WUTjIM=; b=dOeAO6pLykpgyv3Ni7WbnlLVQwMG25+1Oh7X2CchAdq1htk18HLJK2euKPMP4Z9J5K/HZs sA4c8wnwarILkyIdqO5nz6ZMkri9KcHgMttC+WU9eZiBMTCFLynyzr2Wqt0jTY2AKN0FXv Tjxxw1p3xmSH07FyesFK94qK2cq+HpY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zznsNNFM1an/LPEUUyOSCoz1lrvKfb3yYqyo3WUTjIM=; b=7bSZ7F5MkvBdkvgNm7fyJZFhujYIU5Iw/Bk/ywj5WhU9Xgf/bKf0ZkFNhZGTdGQUxFKtYI HK1Gk/wTinH1xHBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zznsNNFM1an/LPEUUyOSCoz1lrvKfb3yYqyo3WUTjIM=; b=dOeAO6pLykpgyv3Ni7WbnlLVQwMG25+1Oh7X2CchAdq1htk18HLJK2euKPMP4Z9J5K/HZs sA4c8wnwarILkyIdqO5nz6ZMkri9KcHgMttC+WU9eZiBMTCFLynyzr2Wqt0jTY2AKN0FXv Tjxxw1p3xmSH07FyesFK94qK2cq+HpY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zznsNNFM1an/LPEUUyOSCoz1lrvKfb3yYqyo3WUTjIM=; b=7bSZ7F5MkvBdkvgNm7fyJZFhujYIU5Iw/Bk/ywj5WhU9Xgf/bKf0ZkFNhZGTdGQUxFKtYI HK1Gk/wTinH1xHBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 45077139B9; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0O1QDyCnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:00 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 15/29] ALSA: ali5451: Embed suspend image into struct snd_ali Date: Wed, 7 Feb 2024 16:51:26 +0100 Message-Id: <20240207155140.18238-16-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[38.62%] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO Instead of allocating the memory with an additional devm_kmalloc(), just put the image into the existing struct snd_ali. The allocation size isn't too big, hence it works better with less allocation calls. Signed-off-by: Takashi Iwai --- sound/pci/ali5451/ali5451.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 2378a39abaeb..9d48638a3ab4 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -244,7 +244,7 @@ struct snd_ali { spinlock_t voice_alloc; #ifdef CONFIG_PM_SLEEP - struct snd_ali_image *image; + struct snd_ali_image image; #endif }; @@ -1829,13 +1829,9 @@ static int ali_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct snd_ali *chip = card->private_data; - struct snd_ali_image *im; + struct snd_ali_image *im = &chip->image; int i, j; - im = chip->image; - if (!im) - return 0; - snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); for (i = 0; i < chip->num_of_codecs; i++) snd_ac97_suspend(chip->ac97[i]); @@ -1872,13 +1868,9 @@ static int ali_resume(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct snd_ali *chip = card->private_data; - struct snd_ali_image *im; + struct snd_ali_image *im = &chip->image; int i, j; - im = chip->image; - if (!im) - return 0; - spin_lock_irq(&chip->reg_lock); for (i = 0; i < ALI_CHANNELS; i++) { @@ -2112,13 +2104,6 @@ static int snd_ali_create(struct snd_card *card, return err; } -#ifdef CONFIG_PM_SLEEP - codec->image = devm_kmalloc(&pci->dev, sizeof(*codec->image), - GFP_KERNEL); - if (!codec->image) - dev_warn(card->dev, "can't allocate apm buffer\n"); -#endif - snd_ali_enable_address_interrupt(codec); codec->hw_initialized = 1; return 0; From patchwork Wed Feb 7 15:51:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548682 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7C7080037 for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=roXnKIJUvxGJsPvP1ZADw96QYSSGzAEZ6+7C6GEGJck/b2IjcUR4vjBB0di4Y7XqbX5DG/M5wqsi65WyakRYbOvZxcyt7+YpCP4N7EAeQIig2KQ59rioLuEzViL3Q8L5/QBoYCawFIG9WFirnv1D8550Y2iEftFItgzVt24XwkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=KOC7QAkUMZj2/YPJGNFl4VdKdqvdwetkWEz0xrcXLro=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ewbP3u75gOf+Ag/jpk9rNn//xbahbB1ZeAJWHah9XZlmBGUNH4sDekxij6Fhqx2fc6ZhZLVx2Kat3nVLvkysnHA7UbQIkP8+pDEZwcHdd5pBJRttUc54ak4cusBUsbBCaNiy3+N4rvVDOVddbu5k0dXkCk0ZU2vqQyZtV1AMpac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=GnDxtZud; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=yvJwv7JY; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=GnDxtZud; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=yvJwv7JY; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="GnDxtZud"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="yvJwv7JY"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="GnDxtZud"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="yvJwv7JY" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8AF5C22317; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pPL+/zLn/nzlLVlESumRshnJm86UjAvROmC7bdX8vuU=; b=GnDxtZudbScI7DR6bTYpwKMXBf1hRz8IAVMrcf6TL/30ujnRQaPye4cAm86KtyHQi934UK G+mXO2cL2YoHyp/rl2MNVjtqUa0JxBITKjdiBYiQG7uSQz36MMzhLiTacbmlaK0PAVgbr2 AsIlIYxE2bwP8O+EcsWLqRLWLq0Wd6w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pPL+/zLn/nzlLVlESumRshnJm86UjAvROmC7bdX8vuU=; b=yvJwv7JYJ4VyYlQqZyW8tGPHLSX8QgwzP6xCBOPMz+H1nPMRseJCY65ROJkqn5VqmVv4y5 Es5dKwBCFg8FD/Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pPL+/zLn/nzlLVlESumRshnJm86UjAvROmC7bdX8vuU=; b=GnDxtZudbScI7DR6bTYpwKMXBf1hRz8IAVMrcf6TL/30ujnRQaPye4cAm86KtyHQi934UK G+mXO2cL2YoHyp/rl2MNVjtqUa0JxBITKjdiBYiQG7uSQz36MMzhLiTacbmlaK0PAVgbr2 AsIlIYxE2bwP8O+EcsWLqRLWLq0Wd6w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pPL+/zLn/nzlLVlESumRshnJm86UjAvROmC7bdX8vuU=; b=yvJwv7JYJ4VyYlQqZyW8tGPHLSX8QgwzP6xCBOPMz+H1nPMRseJCY65ROJkqn5VqmVv4y5 Es5dKwBCFg8FD/Ag== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6C61A139D8; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id SADlGCCnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:00 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 16/29] ALSA: ali5451: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:27 +0100 Message-Id: <20240207155140.18238-17-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.62 X-Spamd-Result: default: False [3.62 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.08)[63.29%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the image even if it's not really used, but the code-simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/ali5451/ali5451.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 9d48638a3ab4..31e51e2df655 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -243,9 +243,7 @@ struct snd_ali { spinlock_t reg_lock; spinlock_t voice_alloc; -#ifdef CONFIG_PM_SLEEP struct snd_ali_image image; -#endif }; static const struct pci_device_id snd_ali_ids[] = { @@ -1824,7 +1822,6 @@ static int snd_ali_mixer(struct snd_ali *codec) return 0; } -#ifdef CONFIG_PM_SLEEP static int ali_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -1900,11 +1897,7 @@ static int ali_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume); -#define ALI_PM_OPS &ali_pm -#else -#define ALI_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume); static void snd_ali_free(struct snd_card *card) { @@ -2166,7 +2159,7 @@ static struct pci_driver ali5451_driver = { .id_table = snd_ali_ids, .probe = snd_ali_probe, .driver = { - .pm = ALI_PM_OPS, + .pm = &ali_pm, }, }; From patchwork Wed Feb 7 15:51:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548675 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6692880BE7 for ; Wed, 7 Feb 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321128; cv=none; b=dLCAhvSLKr1hlIm9vST/WommHwmpptzV9WNyNBmmY1pIVzCWj89FubdIDYhbpP2lsy7aBf3Zd08LGQy3+dQpPoyZS1LqJljpOTboD7LQFq2kR1twtoF2GLhNjN41YsB/cRKu21iaCATEKl9oX00eVtCCAg95iMTIWOL6L0teW+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321128; c=relaxed/simple; bh=9IOPuf/YlnoCiqYIm2jIXNvZZS5WqkQzmX8zewXrD/Y=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T8PXLz4GnPlu5K+C4pg4KajyiL65WPkglU6aKx1fmWT2iOfS1J3mG/OBhYujnXsvV/g6eys1Qq+I/+l3VlvmwABZJswFmCaBJEErWHPHy+hEOmD2TiydeUmROdb0QUT4Qm8HtPZ2dj5rX/sxrr+dZu1rWDQPR0WyzSoDhiAVp+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=O2YfXGSk; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iWIzCHzw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=O2YfXGSk; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iWIzCHzw; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="O2YfXGSk"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iWIzCHzw"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="O2YfXGSk"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iWIzCHzw" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B17DE1FC25; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tbh/wztk8t2SV2JJ032ndvlCsQzLmQfvmKVf0/WVhLE=; b=O2YfXGSkT1jJ163zxkyMDHX2xVS53f/PpHcSsqJr0rO4/vHwAlP/Pmm+uKdO0bfhL1Ni6p 0v0E4qmq0rMQ+g4WBubRLVcWl+JHtDkwHnUrAoyaayNE4YxvS/Dv+KC6QrREnFtDxo1T9S fGn7nK1Ktepfv0wPMGnCZjUD+MIGezQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tbh/wztk8t2SV2JJ032ndvlCsQzLmQfvmKVf0/WVhLE=; b=iWIzCHzwiN6JP6TpwdmWRjHa+h1db5Rgi89kc4CQ+KuA99Ofo2Jfd+QZDqOLXZU2iIzUpP iYGh9XdpXVbqUcBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tbh/wztk8t2SV2JJ032ndvlCsQzLmQfvmKVf0/WVhLE=; b=O2YfXGSkT1jJ163zxkyMDHX2xVS53f/PpHcSsqJr0rO4/vHwAlP/Pmm+uKdO0bfhL1Ni6p 0v0E4qmq0rMQ+g4WBubRLVcWl+JHtDkwHnUrAoyaayNE4YxvS/Dv+KC6QrREnFtDxo1T9S fGn7nK1Ktepfv0wPMGnCZjUD+MIGezQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tbh/wztk8t2SV2JJ032ndvlCsQzLmQfvmKVf0/WVhLE=; b=iWIzCHzwiN6JP6TpwdmWRjHa+h1db5Rgi89kc4CQ+KuA99Ofo2Jfd+QZDqOLXZU2iIzUpP iYGh9XdpXVbqUcBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 92E05139B9; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id oIEbIiCnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:00 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 17/29] ALSA: azt3328: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:28 +0100 Message-Id: <20240207155140.18238-18-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=O2YfXGSk; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=iWIzCHzw X-Spamd-Result: default: False [4.68 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[50.86%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.68 X-Rspamd-Queue-Id: B17DE1FC25 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/azt3328.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 431f0026b507..84989c291cd7 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c @@ -295,7 +295,6 @@ struct snd_azf3328 { * CONFIG_PM register storage below, but that's slightly difficult. */ u16 shadow_reg_ctrl_6AH; -#ifdef CONFIG_PM_SLEEP /* register value containers for power management * Note: not always full I/O range preserved (similar to Win driver!) */ u32 saved_regs_ctrl[AZF_ALIGN(AZF_IO_SIZE_CTRL_PM) / 4]; @@ -303,7 +302,6 @@ struct snd_azf3328 { u32 saved_regs_mpu[AZF_ALIGN(AZF_IO_SIZE_MPU_PM) / 4]; u32 saved_regs_opl3[AZF_ALIGN(AZF_IO_SIZE_OPL3_PM) / 4]; u32 saved_regs_mixer[AZF_ALIGN(AZF_IO_SIZE_MIXER_PM) / 4]; -#endif }; static const struct pci_device_id snd_azf3328_ids[] = { @@ -2517,7 +2515,6 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) return snd_card_free_on_error(&pci->dev, __snd_azf3328_probe(pci, pci_id)); } -#ifdef CONFIG_PM_SLEEP static inline void snd_azf3328_suspend_regs(const struct snd_azf3328 *chip, unsigned long io_addr, unsigned count, u32 *saved_regs) @@ -2633,18 +2630,14 @@ snd_azf3328_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_azf3328_pm, snd_azf3328_suspend, snd_azf3328_resume); -#define SND_AZF3328_PM_OPS &snd_azf3328_pm -#else -#define SND_AZF3328_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_azf3328_pm, snd_azf3328_suspend, snd_azf3328_resume); static struct pci_driver azf3328_driver = { .name = KBUILD_MODNAME, .id_table = snd_azf3328_ids, .probe = snd_azf3328_probe, .driver = { - .pm = SND_AZF3328_PM_OPS, + .pm = &snd_azf3328_pm, }, }; From patchwork Wed Feb 7 15:51:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548683 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 340068063E for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=OS0qAByrZ6w2vTehPJ/VS0yDulovetFrQHQEM+dPLKRg/N2mNYvWDB2srmhIoVrf6rNzTYCfDt2zT6+zxCjXh0KW8jU0nGNOxAdRxv5LLosGfLSLajpDlQpShjSggM93zfmag+1GnEB5R/tyvEUj0Kl6y+PNcLypm+r6i37dwSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=kJZNfXGox3scysyR03uNMxn12kNjx9RlWjUIvqvsa6Y=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HFwVdb+nwVSmyEhrX/HPhi2LCKUCTIq5TkKag2c5HY6NzsQQgFaTct1UaU7zp0B2eQhKKXVf2VWCMqgMLqYnLnW0vBS37WH7tnm7yXWow7zRA2imm27UxklsFafX0WV9Ox0hx1vGBUKlYeeBHABNeiktwSQAIBQXkQU9tO/5vKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=D3akiQi2; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=22e0uEk4; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=D3akiQi2; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=22e0uEk4; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="D3akiQi2"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="22e0uEk4"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="D3akiQi2"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="22e0uEk4" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DA3B61FC26; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bDyjS/cWS6agHOHrgreh3fHc9jxQJJ3F4g5ASprj+pg=; b=D3akiQi2nCJADrBBia20MTHwRja0WCDhi5eRLaQTME8vvphyR0U7+3Pb//PHnAwKFDOz+q 2s28KeGAkXFrB4G74PLx3EvuyPVCeDPB1lM+UyrY3nUtkh+P/v+SNGnyxpbj+FePZ77dmO /Em8kt8F4bflnS95c7n32emp2LAcuL8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bDyjS/cWS6agHOHrgreh3fHc9jxQJJ3F4g5ASprj+pg=; b=22e0uEk4KspwgOTjLoXwzVLSBqcZ3aAKu/qZGQVfCd/IsklYlgAtEZ6i1Wgl8l1rE+x06Z ZIypY/c5butFx0DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bDyjS/cWS6agHOHrgreh3fHc9jxQJJ3F4g5ASprj+pg=; b=D3akiQi2nCJADrBBia20MTHwRja0WCDhi5eRLaQTME8vvphyR0U7+3Pb//PHnAwKFDOz+q 2s28KeGAkXFrB4G74PLx3EvuyPVCeDPB1lM+UyrY3nUtkh+P/v+SNGnyxpbj+FePZ77dmO /Em8kt8F4bflnS95c7n32emp2LAcuL8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bDyjS/cWS6agHOHrgreh3fHc9jxQJJ3F4g5ASprj+pg=; b=22e0uEk4KspwgOTjLoXwzVLSBqcZ3aAKu/qZGQVfCd/IsklYlgAtEZ6i1Wgl8l1rE+x06Z ZIypY/c5butFx0DQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BA3BD139D8; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id oOHPKyCnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:00 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 18/29] ALSA: cmipci: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:29 +0100 Message-Id: <20240207155140.18238-19-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.69 X-Spamd-Result: default: False [3.69 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[50.22%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/cmipci.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 08e34b184780..36014501f7ed 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -486,10 +486,8 @@ struct cmipci { spinlock_t reg_lock; -#ifdef CONFIG_PM_SLEEP unsigned int saved_regs[0x20]; unsigned char saved_mixers[0x20]; -#endif }; @@ -3260,7 +3258,6 @@ static int snd_cmipci_probe(struct pci_dev *pci, return err; } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -3324,18 +3321,14 @@ static int snd_cmipci_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume); -#define SND_CMIPCI_PM_OPS &snd_cmipci_pm -#else -#define SND_CMIPCI_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume); static struct pci_driver cmipci_driver = { .name = KBUILD_MODNAME, .id_table = snd_cmipci_ids, .probe = snd_cmipci_probe, .driver = { - .pm = SND_CMIPCI_PM_OPS, + .pm = &snd_cmipci_pm, }, }; From patchwork Wed Feb 7 15:51:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548676 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3504080BE2 for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=W7CogaUfpB544JFkSeCs4Ltt+fQ6dK7XmIjTS1pQFHmmEtSpUaoSL68Q/zte/VVZyYQ5dSm2Zeu2c5NO1sxPVGGo6WpM1VjWwLffzwrT4XeronfMO6UwueCE6MCqEQwhldQFzqFNbqExCdloTNrkXBJ57f80uH5Jw6rzbRz5uiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=C4sQcdjpeWWcvV/ymRaHidBFcus+jOw5znsfV15qhyM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R4DtA6lOhpSrOZiuDcWf8Pa8LCftIOFJlnVMWFm/a6CnBjANMYKFNNrPgOLsGEMdzItSzdYfTsCe+NjyJnrSKG2ttR4T6d42bFUJ1B9ty3/N7pnuI+V/k8unWKP3eJwUz+WO08+h01KRu59SaHDFgT2KwQ/R1BrBBOB8MY8pnWI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=vbAkn60T; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=1anFTRVf; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=vbAkn60T; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=1anFTRVf; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="vbAkn60T"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="1anFTRVf"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="vbAkn60T"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="1anFTRVf" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0BF9722333; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3sYY9dH4jNephRSgJJ0NbDmxP9K9epcBIJjOE+R3rQ=; b=vbAkn60TErltfJZZfcgJs3WOm/JdolJvrpv1gGFFlrMD7YoKKNHSVVeMJn4L2d5OUhy7Rd h2xBN4vz335j9R62VP/UW1mlnsuMB9eGky5okI2AXp9v6pvPh/xnjGocYhBoT+5bJIJ+16 oKTJuFSBOTiQ95viFmA8JYNMXdjbEPE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3sYY9dH4jNephRSgJJ0NbDmxP9K9epcBIJjOE+R3rQ=; b=1anFTRVfeXD9gVyYXwyuOr2AEhzr3cQKU7Z9MCZWKvkGQT8KPnXkZaYlI2VuIQnN7zJTjm 9XMVma94d8bc0EBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3sYY9dH4jNephRSgJJ0NbDmxP9K9epcBIJjOE+R3rQ=; b=vbAkn60TErltfJZZfcgJs3WOm/JdolJvrpv1gGFFlrMD7YoKKNHSVVeMJn4L2d5OUhy7Rd h2xBN4vz335j9R62VP/UW1mlnsuMB9eGky5okI2AXp9v6pvPh/xnjGocYhBoT+5bJIJ+16 oKTJuFSBOTiQ95viFmA8JYNMXdjbEPE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3sYY9dH4jNephRSgJJ0NbDmxP9K9epcBIJjOE+R3rQ=; b=1anFTRVfeXD9gVyYXwyuOr2AEhzr3cQKU7Z9MCZWKvkGQT8KPnXkZaYlI2VuIQnN7zJTjm 9XMVma94d8bc0EBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E1E8A139B9; Wed, 7 Feb 2024 15:52:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id QHOoNSCnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:00 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 19/29] ALSA: cs4281: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:30 +0100 Message-Id: <20240207155140.18238-20-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=vbAkn60T; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=1anFTRVf X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.09)[64.59%] X-Spam-Score: -0.10 X-Rspamd-Queue-Id: 0BF9722333 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/cs4281.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 0c9cadf7b3b8..0cc86e73cc62 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -470,10 +470,7 @@ struct cs4281 { struct gameport *gameport; -#ifdef CONFIG_PM_SLEEP u32 suspend_regs[SUSPEND_REGISTERS]; -#endif - }; static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id); @@ -1897,8 +1894,6 @@ static int snd_cs4281_probe(struct pci_dev *pci, /* * Power Management */ -#ifdef CONFIG_PM_SLEEP - static const int saved_regs[SUSPEND_REGISTERS] = { BA0_JSCTL, BA0_GPIOR, @@ -1987,18 +1982,14 @@ static int cs4281_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume); -#define CS4281_PM_OPS &cs4281_pm -#else -#define CS4281_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume); static struct pci_driver cs4281_driver = { .name = KBUILD_MODNAME, .id_table = snd_cs4281_ids, .probe = snd_cs4281_probe, .driver = { - .pm = CS4281_PM_OPS, + .pm = &cs4281_pm, }, }; From patchwork Wed Feb 7 15:51:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548684 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 668C680BE6 for ; Wed, 7 Feb 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321130; cv=none; b=dlMNRXPujOn+9oxe4B+r19HDwU0RcW4uvPrGc0hdwaDWlitA2Tir/2zfJdjUKHbRvOK5yKlleiwX3wFMey4EiXYd4n84hRGwEDZKeqw5R8qiI6yb/rU9ryZCkMcI4ELng38UU706Z6lPkQx5dJLnHvLT668jjbEUUoSOcK7nzV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321130; c=relaxed/simple; bh=TtULtGEypVyIrr2BOIIU4bONm0RjM3rTVPB/BWs4gDk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tn704O6Hzfc1TPTPcBEf2O+xHmSB/jL5ACdnUm96k5PvrTAYLEVMnuZMykiziKIgGZnBqC/mawQ+7AQDRqNKUGK3EQx1NUIZaGt3j0PVehvtKuci4MSS++Yw2Pjg56evZcr10zpm9KTp7zfb4jhmZ/cDoawS3W9PJ5DG4nHLcQQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=f4yF34cF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=hXPDeptT; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=f4yF34cF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=hXPDeptT; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="f4yF34cF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hXPDeptT"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="f4yF34cF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hXPDeptT" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3259F1FC30; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HDo72WBboH+JOvfy8J/FoBdZHbIOVqhIZaF9fkVE0Ts=; b=f4yF34cFAJKLu5ej63ziiCT3uiGp3CIUlSEtg1dcP9h/aeDLvRT/zEhhn9UG1pdxRJouAT LdbKtKvJP7ZWt+xacZBDpePSrSvLHNzs5mp9DT1YGndEiXTfsmzlcSBjICZFN36IkNgj0s f/z62zK/c/F44kfen+AgThILOm/JiQc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HDo72WBboH+JOvfy8J/FoBdZHbIOVqhIZaF9fkVE0Ts=; b=hXPDeptTgSYwBpPNppe+rRGajSy4BMa40SbhK/O8gcv+nCB13qLbckJNXGYKd1Exs1obtT 77knPew73dwEPOBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HDo72WBboH+JOvfy8J/FoBdZHbIOVqhIZaF9fkVE0Ts=; b=f4yF34cFAJKLu5ej63ziiCT3uiGp3CIUlSEtg1dcP9h/aeDLvRT/zEhhn9UG1pdxRJouAT LdbKtKvJP7ZWt+xacZBDpePSrSvLHNzs5mp9DT1YGndEiXTfsmzlcSBjICZFN36IkNgj0s f/z62zK/c/F44kfen+AgThILOm/JiQc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HDo72WBboH+JOvfy8J/FoBdZHbIOVqhIZaF9fkVE0Ts=; b=hXPDeptTgSYwBpPNppe+rRGajSy4BMa40SbhK/O8gcv+nCB13qLbckJNXGYKd1Exs1obtT 77knPew73dwEPOBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 13DA6139D8; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6KVQAyGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 20/29] ALSA: echoaudio: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:31 +0100 Message-Id: <20240207155140.18238-21-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=f4yF34cF; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=hXPDeptT X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -0.01 X-Rspamd-Queue-Id: 3259F1FC30 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of firmware caches if it's not really used without CONFIG_PM, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/echoaudio/echoaudio.c | 21 ++------------------- sound/pci/echoaudio/echoaudio.h | 2 -- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index c70c3ac4e99a..7484de255a3e 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -34,7 +34,6 @@ static int get_firmware(const struct firmware **fw_entry, int err; char name[30]; -#ifdef CONFIG_PM_SLEEP if (chip->fw_cache[fw_index]) { dev_dbg(chip->card->dev, "firmware requested: %s is cached\n", @@ -42,7 +41,6 @@ static int get_firmware(const struct firmware **fw_entry, *fw_entry = chip->fw_cache[fw_index]; return 0; } -#endif dev_dbg(chip->card->dev, "firmware requested: %s\n", card_fw[fw_index].data); @@ -51,10 +49,8 @@ static int get_firmware(const struct firmware **fw_entry, if (err < 0) dev_err(chip->card->dev, "get_firmware(): Firmware not available (%d)\n", err); -#ifdef CONFIG_PM_SLEEP else chip->fw_cache[fw_index] = *fw_entry; -#endif return err; } @@ -63,18 +59,13 @@ static int get_firmware(const struct firmware **fw_entry, static void free_firmware(const struct firmware *fw_entry, struct echoaudio *chip) { -#ifdef CONFIG_PM_SLEEP dev_dbg(chip->card->dev, "firmware not released (kept in cache)\n"); -#else - release_firmware(fw_entry); -#endif } static void free_firmware_cache(struct echoaudio *chip) { -#ifdef CONFIG_PM_SLEEP int i; for (i = 0; i < 8 ; i++) @@ -82,8 +73,6 @@ static void free_firmware_cache(struct echoaudio *chip) release_firmware(chip->fw_cache[i]); dev_dbg(chip->card->dev, "release_firmware(%d)\n", i); } - -#endif } @@ -2146,8 +2135,6 @@ static int snd_echo_probe(struct pci_dev *pci, } -#if defined(CONFIG_PM_SLEEP) - static int snd_echo_suspend(struct device *dev) { struct echoaudio *chip = dev_get_drvdata(dev); @@ -2237,11 +2224,7 @@ static int snd_echo_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_echo_pm, snd_echo_suspend, snd_echo_resume); -#define SND_ECHO_PM_OPS &snd_echo_pm -#else -#define SND_ECHO_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_echo_pm, snd_echo_suspend, snd_echo_resume); /****************************************************************************** Everything starts and ends here @@ -2253,7 +2236,7 @@ static struct pci_driver echo_driver = { .id_table = snd_echo_ids, .probe = snd_echo_probe, .driver = { - .pm = SND_ECHO_PM_OPS, + .pm = &snd_echo_pm, }, }; diff --git a/sound/pci/echoaudio/echoaudio.h b/sound/pci/echoaudio/echoaudio.h index d51de3e4edfa..511f2fcc0fb9 100644 --- a/sound/pci/echoaudio/echoaudio.h +++ b/sound/pci/echoaudio/echoaudio.h @@ -422,9 +422,7 @@ struct echoaudio { u32 __iomem *dsp_registers; /* DSP's register base */ u32 active_mask; /* Chs. active mask or * punks out */ -#ifdef CONFIG_PM_SLEEP const struct firmware *fw_cache[8]; /* Cached firmwares */ -#endif #ifdef ECHOCARD_HAS_MIDI u16 mtc_state; /* State for MIDI input parsing state machine */ From patchwork Wed Feb 7 15:51:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548678 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 679B980BEA for ; Wed, 7 Feb 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=Ka6z8QTP072Q+rULI6iE53fyez8xH6Ct1RlugN/zWfuk1FTYAGyBrqmhyop1oShylDWd8mHWehrEnqLR9a3iIXeuxR38sF3GZu44atYs8P2ha5DImyTDsx7zSiCZufHM7r6i11AhXhwXVBsnkOJTdj4iriFHc/gxHGMgCuMZwxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=TFxDqmodC0dPcnqSPJZcO8/tu+U8D7YUK8FzJWQCFbk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lm2wJqFmABOIltkeBH2UqyYCy+S/jEtRlrAXGJy9Vp7O6yjGluGyIN09OTfXOPm4Q/f2s/NfkOVeMkiQ6NrvfutbUcvxVu1X5v46MOw/+dxIk9jdx/GC2HdDEtlCDFH15aBBHLOjJUHSn543frWY2hU7KiEyRF8NE3R2xf9mado= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=A4K0Yfo6; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uFSvcXKM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=A4K0Yfo6; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uFSvcXKM; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="A4K0Yfo6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uFSvcXKM"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="A4K0Yfo6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uFSvcXKM" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5AD511FC81; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=16NhmWpNbx9Lf2GN0v9lg9275T0VINQUew4BU1QJ12U=; b=A4K0Yfo6TjFFkHZOSNMtF7ZN91U99ymAZ81kBIP9htjF85Ch1PSErfBAaGXI+w+GnbCUJX 0cvtT/B44PHCn7nKt35tAfa4mlYb+YYh2qdjy1iwbckF8J9+ED8AtdPJ2BCf2yocnT84nd ul1262M7y4984v3uRQtCXaEPtM8ao98= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=16NhmWpNbx9Lf2GN0v9lg9275T0VINQUew4BU1QJ12U=; b=uFSvcXKMkAwMh01BxWph7w90NAeye5424XPCoPPIJwPiutLtgt2Mr3sk07D6pJaNeB0FF9 BGBDRGMq5ZWHSuAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=16NhmWpNbx9Lf2GN0v9lg9275T0VINQUew4BU1QJ12U=; b=A4K0Yfo6TjFFkHZOSNMtF7ZN91U99ymAZ81kBIP9htjF85Ch1PSErfBAaGXI+w+GnbCUJX 0cvtT/B44PHCn7nKt35tAfa4mlYb+YYh2qdjy1iwbckF8J9+ED8AtdPJ2BCf2yocnT84nd ul1262M7y4984v3uRQtCXaEPtM8ao98= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=16NhmWpNbx9Lf2GN0v9lg9275T0VINQUew4BU1QJ12U=; b=uFSvcXKMkAwMh01BxWph7w90NAeye5424XPCoPPIJwPiutLtgt2Mr3sk07D6pJaNeB0FF9 BGBDRGMq5ZWHSuAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3A90513A41; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id WCzEDCGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 21/29] ALSA: es1938: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:32 +0100 Message-Id: <20240207155140.18238-22-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=A4K0Yfo6; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=uFSvcXKM X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.06 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.05)[60.04%] X-Spam-Score: -0.06 X-Rspamd-Queue-Id: 5AD511FC81 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/es1938.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index ec598ba1a883..018a8d53ca53 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c @@ -216,9 +216,7 @@ struct es1938 { #ifdef SUPPORT_JOYSTICK struct gameport *gameport; #endif -#ifdef CONFIG_PM_SLEEP unsigned char saved_regs[SAVED_REG_SIZE]; -#endif }; static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id); @@ -1395,7 +1393,6 @@ static void snd_es1938_chip_init(struct es1938 *chip) outb(0, SLDM_REG(chip, DMACLEAR)); } -#ifdef CONFIG_PM_SLEEP /* * PM support */ @@ -1461,11 +1458,7 @@ static int es1938_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); -#define ES1938_PM_OPS &es1938_pm -#else -#define ES1938_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); #ifdef SUPPORT_JOYSTICK static int snd_es1938_create_gameport(struct es1938 *chip) @@ -1787,7 +1780,7 @@ static struct pci_driver es1938_driver = { .id_table = snd_es1938_ids, .probe = snd_es1938_probe, .driver = { - .pm = ES1938_PM_OPS, + .pm = &es1938_pm, }, }; From patchwork Wed Feb 7 15:51:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548686 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AD438003C for ; Wed, 7 Feb 2024 15:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; cv=none; b=EpQefTssKkBF9p/FVCJvYmLHaA/jKUhji891uWs4CFw3zOP4E0P1RCWGqZDby2hQYvkE91p4XrtF7fQWCw97pRJnXR2iPeB4elMWSoDdWJfdfwEYIgV77T6OAmh2yUcjbD4oc30nVydiF6f4z7sY9dZJw548S0HyZqlgHGcjRqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; c=relaxed/simple; bh=oA2eRU1rfSombLJpOwoQjJ8faH4IyOwrjWL2x8RVX+E=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YVypbNN9TfyJNJYhEddns33YEiBxQ/WDYa98Zvj0vyz0nyuoavxO13lvrjl13Q7jIVDwVdalQ8nEb6ocXH4OxM0S46kpRFdmUgyDG9Qa75vIDGzR81axDjOGN6dH0ROgYyXAVA+LVpz3ERCOkgYVcVmMFDeCh6ms2RXRA20RtxI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OMyRHSxZ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iZHhMqFN; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OMyRHSxZ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iZHhMqFN; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OMyRHSxZ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iZHhMqFN"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OMyRHSxZ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iZHhMqFN" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7E8FB1FC06; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0X112EvfeOD2uEGnx1mO044CRoezx82FC0EzphY8bgM=; b=OMyRHSxZNyhIiSw0K35YGSIcFlmveeUgyZvk4r+H1hv6a6q6aSGcUrSJyJIH6peYd3igIa wYQC0PVeaZyOkRBMQ2pCoHLig3lmPRyuxBH1n+hAgCF3nQDwqKtOZmfOkh2gm3AOOsuW0c +nmvG11tHnly6J96fBoabATHwT7B44c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0X112EvfeOD2uEGnx1mO044CRoezx82FC0EzphY8bgM=; b=iZHhMqFNB6sM+FgdR+C6DJ/CfJXe5S+CVViQjTPR+rH8HhhSYnjuWa0fKNtOTG9mbnnARH hytnLei16l729hDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0X112EvfeOD2uEGnx1mO044CRoezx82FC0EzphY8bgM=; b=OMyRHSxZNyhIiSw0K35YGSIcFlmveeUgyZvk4r+H1hv6a6q6aSGcUrSJyJIH6peYd3igIa wYQC0PVeaZyOkRBMQ2pCoHLig3lmPRyuxBH1n+hAgCF3nQDwqKtOZmfOkh2gm3AOOsuW0c +nmvG11tHnly6J96fBoabATHwT7B44c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0X112EvfeOD2uEGnx1mO044CRoezx82FC0EzphY8bgM=; b=iZHhMqFNB6sM+FgdR+C6DJ/CfJXe5S+CVViQjTPR+rH8HhhSYnjuWa0fKNtOTG9mbnnARH hytnLei16l729hDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 61E17139D8; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id UOoxFiGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 22/29] ALSA: es1968: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:33 +0100 Message-Id: <20240207155140.18238-23-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=OMyRHSxZ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=iZHhMqFN X-Spamd-Result: default: False [4.68 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[50.14%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.68 X-Rspamd-Queue-Id: 7E8FB1FC06 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/es1968.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 4bc0f53c223b..c6c018b40c69 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -473,9 +473,7 @@ struct esschan { /* linked list */ struct list_head list; -#ifdef CONFIG_PM_SLEEP u16 wc_map[4]; -#endif }; struct es1968 { @@ -526,9 +524,7 @@ struct es1968 { struct list_head substream_list; spinlock_t substream_lock; -#ifdef CONFIG_PM_SLEEP u16 apu_map[NR_APUS][NR_APU_REGS]; -#endif #ifdef SUPPORT_JOYSTICK struct gameport *gameport; @@ -689,9 +685,7 @@ static void __apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 dat { if (snd_BUG_ON(channel >= NR_APUS)) return; -#ifdef CONFIG_PM_SLEEP chip->apu_map[channel][reg] = data; -#endif reg |= (channel << 4); apu_index_set(chip, reg); apu_data_set(chip, data); @@ -976,9 +970,7 @@ static void snd_es1968_program_wavecache(struct es1968 *chip, struct esschan *es /* set the wavecache control reg */ wave_set_register(chip, es->apu[channel] << 3, tmpval); -#ifdef CONFIG_PM_SLEEP es->wc_map[channel] = tmpval; -#endif } @@ -2356,7 +2348,6 @@ static void snd_es1968_start_irq(struct es1968 *chip) outw(w, chip->io_port + ESM_PORT_HOST_IRQ); } -#ifdef CONFIG_PM_SLEEP /* * PM support */ @@ -2418,11 +2409,7 @@ static int es1968_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume); -#define ES1968_PM_OPS &es1968_pm -#else -#define ES1968_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume); #ifdef SUPPORT_JOYSTICK #define JOYSTICK_ADDR 0x200 @@ -2852,7 +2839,7 @@ static struct pci_driver es1968_driver = { .id_table = snd_es1968_ids, .probe = snd_es1968_probe, .driver = { - .pm = ES1968_PM_OPS, + .pm = &es1968_pm, }, }; From patchwork Wed Feb 7 15:51:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548679 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B0F580045 for ; Wed, 7 Feb 2024 15:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=jtDBOzYyil9mRzqrp2izwwJ4JH3WcASIN3g9CP9gfsn5VbZfPfW2zd29gDmVF9z+kqMZEbxCxEAjpfBF55aNoVKencLMZctZK+cgBqRvqAiUloTCn/0jweVi3fo+WAfHC8qOTZwcYq1ZiyRZjV0fzsJU0uFKg31jNhG4tBmNpbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=LFcq+sQunpjhHnXUmliaRbD+AxqT07idmnBu0xVvjmI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OqGFvg5BsrcrB+DmS0stVXkr3GL7wCKUB4fKVip4wA5Yg977Dos4fm5725Q20UpmdQZ7lflGDiduUALMfwg3w7Yi5g37T2uwssXHxvLvsRdYjezeE7DUB4FM2zJGAEjL3ZTpPtvr4qi/XvMXIKsrKybb4fTFd7hqoJaVvnftRBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=bnL4Y/rl; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=I28IbGO1; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=bnL4Y/rl; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=I28IbGO1; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bnL4Y/rl"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="I28IbGO1"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bnL4Y/rl"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="I28IbGO1" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B00AE1FC29; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CDYlozzJoNiSDlgW9hPmCl4hrWomjUtNLLnJFgd7OWM=; b=bnL4Y/rl2FGoIVJbQmvr9AFxMq+zdq27wvNbK6Gmkiyx7vFNWPG8hXsGBWKDPfvwLQiViD MbjkrP0ucN6+nAEEQRJWiCfqRIZWpNkAfNdsrGpDkn97T/wBg9sQRjIK4bHkoLMuEX9ZYy Dbq/v/uIfsUx69vkNCrWpfxF8zShBSk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CDYlozzJoNiSDlgW9hPmCl4hrWomjUtNLLnJFgd7OWM=; b=I28IbGO18S1ZKvIVPGB2voggD2lJ2KvhHuiuFkoG/DKWVKVguL3VCr9fMuMDeqqqgUxZGc T6aQfiz/AXYRr6CQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CDYlozzJoNiSDlgW9hPmCl4hrWomjUtNLLnJFgd7OWM=; b=bnL4Y/rl2FGoIVJbQmvr9AFxMq+zdq27wvNbK6Gmkiyx7vFNWPG8hXsGBWKDPfvwLQiViD MbjkrP0ucN6+nAEEQRJWiCfqRIZWpNkAfNdsrGpDkn97T/wBg9sQRjIK4bHkoLMuEX9ZYy Dbq/v/uIfsUx69vkNCrWpfxF8zShBSk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CDYlozzJoNiSDlgW9hPmCl4hrWomjUtNLLnJFgd7OWM=; b=I28IbGO18S1ZKvIVPGB2voggD2lJ2KvhHuiuFkoG/DKWVKVguL3VCr9fMuMDeqqqgUxZGc T6aQfiz/AXYRr6CQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8798A13A41; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id MB2iHyGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 23/29] ALSA: fm801: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:34 +0100 Message-Id: <20240207155140.18238-24-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="bnL4Y/rl"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=I28IbGO1 X-Spamd-Result: default: False [4.66 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.03)[56.00%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.66 X-Rspamd-Queue-Id: B00AE1FC29 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/fm801.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 62b3cb126c6d..7f4834c2d5e6 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -222,9 +222,7 @@ struct fm801 { struct snd_tea575x tea; #endif -#ifdef CONFIG_PM_SLEEP u16 saved_regs[0x20]; -#endif }; /* @@ -1339,7 +1337,6 @@ static int snd_card_fm801_probe(struct pci_dev *pci, return snd_card_free_on_error(&pci->dev, __snd_card_fm801_probe(pci, pci_id)); } -#ifdef CONFIG_PM_SLEEP static const unsigned char saved_regs[] = { FM801_PCM_VOL, FM801_I2S_VOL, FM801_FM_VOL, FM801_REC_SRC, FM801_PLY_CTRL, FM801_PLY_COUNT, FM801_PLY_BUF1, FM801_PLY_BUF2, @@ -1396,18 +1393,14 @@ static int snd_fm801_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume); -#define SND_FM801_PM_OPS &snd_fm801_pm -#else -#define SND_FM801_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume); static struct pci_driver fm801_driver = { .name = KBUILD_MODNAME, .id_table = snd_fm801_ids, .probe = snd_card_fm801_probe, .driver = { - .pm = SND_FM801_PM_OPS, + .pm = &snd_fm801_pm, }, }; From patchwork Wed Feb 7 15:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548687 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 086008063C for ; Wed, 7 Feb 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; cv=none; b=kzE6x2nVkjs2CN+VOYMc48HlsExkCroTM+RpY0ZFSiKR3mWGyKDCmIgHqnRM7TcR/URb4MNxOxBAXm8zdYLDEoGdHuyZnib6/i5Dm9XTatrLWyggEjlNJ2b0K/p5yEGSvOMQhnpjmwdZxzVG3MmV1f0nqStzQoxLyIqAh7vkhIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; c=relaxed/simple; bh=kUSahc+1IDWx7cmStE1yAyD98pZzPjAkE3e/SNL1zi8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RMIX5NGE7zG6T4gkvW7HNH9nMOigv9CDAwcEyxM/NuRKbe0Op9mTT5DDhSVTwJU1vKgSXfsX+AUQrcHIdE9nDh+rxffnbfByyPOTq7jgW6faNbbbnaMi0hU5i055yTUs0AqgoIrfXVK4uwd+94x8Qg6ovNJ04ck145RTIP+skYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Xbb+96p2; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=gRh9RWIt; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Xbb+96p2; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=gRh9RWIt; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Xbb+96p2"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="gRh9RWIt"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Xbb+96p2"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="gRh9RWIt" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CEC7822338; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+YMArDc8aR3Wmg1nRPYI2uXhA5bjCAix4Xp14nbBVn4=; b=Xbb+96p2cyB3GfhsDIV8Gf1132nd0tQ91wurPkGiVHQMtMNkyiHbcmNbbA6z1J9hPmIXdl I07eOcTrySF7mtC6L0tHNh2A/AMZyt5FKskVzFKjAGZZZE54Zr+FqIrnRtB73x9eEj2B19 +ibQTbRW21LLzChwdN4SM31kph8PVZI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+YMArDc8aR3Wmg1nRPYI2uXhA5bjCAix4Xp14nbBVn4=; b=gRh9RWItTUrNZtSzsGvnpu1WyM1dbLCt75RmyfvtixwG8gpdKSDE6C0OYzOp1BsQtMrTxg oNbPiTUuz2ScgNCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+YMArDc8aR3Wmg1nRPYI2uXhA5bjCAix4Xp14nbBVn4=; b=Xbb+96p2cyB3GfhsDIV8Gf1132nd0tQ91wurPkGiVHQMtMNkyiHbcmNbbA6z1J9hPmIXdl I07eOcTrySF7mtC6L0tHNh2A/AMZyt5FKskVzFKjAGZZZE54Zr+FqIrnRtB73x9eEj2B19 +ibQTbRW21LLzChwdN4SM31kph8PVZI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+YMArDc8aR3Wmg1nRPYI2uXhA5bjCAix4Xp14nbBVn4=; b=gRh9RWItTUrNZtSzsGvnpu1WyM1dbLCt75RmyfvtixwG8gpdKSDE6C0OYzOp1BsQtMrTxg oNbPiTUuz2ScgNCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id AE283139D8; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id WN8NKSGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 24/29] ALSA: maestro3: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:35 +0100 Message-Id: <20240207155140.18238-25-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Xbb+96p2; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=gRh9RWIt X-Spamd-Result: default: False [4.68 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[51.33%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.68 X-Rspamd-Queue-Id: CEC7822338 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. The area for register dump is conditionally allocated instead of ifdef now. Signed-off-by: Takashi Iwai --- sound/pci/maestro3.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 305cbd24a391..f4d211970d7e 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -769,9 +769,7 @@ struct snd_m3 { unsigned int in_suspend; -#ifdef CONFIG_PM_SLEEP u16 *suspend_mem; -#endif const struct firmware *assp_kernel_image; const struct firmware *assp_minisrc_image; @@ -2354,9 +2352,7 @@ static void snd_m3_free(struct snd_card *card) outw(0, chip->iobase + HOST_INT_CTRL); /* disable ints */ } -#ifdef CONFIG_PM_SLEEP vfree(chip->suspend_mem); -#endif release_firmware(chip->assp_kernel_image); release_firmware(chip->assp_minisrc_image); } @@ -2365,7 +2361,6 @@ static void snd_m3_free(struct snd_card *card) /* * APM support */ -#ifdef CONFIG_PM_SLEEP static int m3_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -2439,11 +2434,7 @@ static int m3_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume); -#define M3_PM_OPS &m3_pm -#else -#define M3_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume); #ifdef CONFIG_SND_MAESTRO3_INPUT static int snd_m3_input_register(struct snd_m3 *chip) @@ -2587,14 +2578,14 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, chip->irq = pci->irq; card->sync_irq = chip->irq; -#ifdef CONFIG_PM_SLEEP - chip->suspend_mem = - vmalloc(array_size(sizeof(u16), - REV_B_CODE_MEMORY_LENGTH + - REV_B_DATA_MEMORY_LENGTH)); - if (chip->suspend_mem == NULL) - dev_warn(card->dev, "can't allocate apm buffer\n"); -#endif + if (IS_ENABLED(CONFIG_PM_SLEEP)) { + chip->suspend_mem = + vmalloc(array_size(sizeof(u16), + REV_B_CODE_MEMORY_LENGTH + + REV_B_DATA_MEMORY_LENGTH)); + if (!chip->suspend_mem) + dev_warn(card->dev, "can't allocate apm buffer\n"); + } err = snd_m3_mixer(chip); if (err < 0) @@ -2706,7 +2697,7 @@ static struct pci_driver m3_driver = { .id_table = snd_m3_ids, .probe = snd_m3_probe, .driver = { - .pm = M3_PM_OPS, + .pm = &m3_pm, }, }; From patchwork Wed Feb 7 15:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548689 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E307C8002F for ; Wed, 7 Feb 2024 15:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; cv=none; b=XvjaLq6cKQS/9QTYpKZ887h+bXQBGSLcr8KgqhehcpW0/x7v9o1QQA/sVcxiSCfGq2+bzo1+n95JwM2Dcdn8tHWSzeBrdnm5bso22K72wyFGt+VcXEJXfyXemJAtsaEpp6eWuRV5oEPc5vDKyXuzbWmudQEq0mLxUjC0qnjNrwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; c=relaxed/simple; bh=Vionlu6dAbbcYlhqj+ppe1J8Dzt40/HJk39ntXo8cLs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WPviavrpzS0K2lwH/0QErOriBN6husFwFd5xrtvRslhBxEXobZ7xGfGLo8XpwVaXwhxJHBweWaMboplR1qF/7VZOViOd4lRHeDZJBxgKe5DfvYrqoax2rV9Z7Llxo7bwg/RT1J+taaK3m91ShuTNi93BGc2QSs1Vl1IiXznvhAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OmHfKq9F; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=D/CEfvQT; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OmHfKq9F; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=D/CEfvQT; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OmHfKq9F"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="D/CEfvQT"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OmHfKq9F"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="D/CEfvQT" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 071041F78B; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y7mEYEZ5ydHj6fVsvL4FUFJ6L7smA/bJbU7Tjxq2EuY=; b=OmHfKq9FizsR5lr+eCdFAJ85MMmKXsadXWfHDmkuKbIaPP1BZ9igoafHq3bbU9HHq1vSBa EnjVQ/FkCEJPGuh26cAu7JbUYlJeyVYbLnT0lhkLLmG8ogLsrFkRls/wZFZuP8NvjxDXl8 8tWyGQoajdZyqq79Cteo1y0rw1Uz/0g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y7mEYEZ5ydHj6fVsvL4FUFJ6L7smA/bJbU7Tjxq2EuY=; b=D/CEfvQTOhy1rbOwN06qR0Pc7VqLRTU8JaA6c1QL8lOINVAgOPkHuwPrrGHINjkB/cyJWj JX8AVaJnShzgH6Bw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y7mEYEZ5ydHj6fVsvL4FUFJ6L7smA/bJbU7Tjxq2EuY=; b=OmHfKq9FizsR5lr+eCdFAJ85MMmKXsadXWfHDmkuKbIaPP1BZ9igoafHq3bbU9HHq1vSBa EnjVQ/FkCEJPGuh26cAu7JbUYlJeyVYbLnT0lhkLLmG8ogLsrFkRls/wZFZuP8NvjxDXl8 8tWyGQoajdZyqq79Cteo1y0rw1Uz/0g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y7mEYEZ5ydHj6fVsvL4FUFJ6L7smA/bJbU7Tjxq2EuY=; b=D/CEfvQTOhy1rbOwN06qR0Pc7VqLRTU8JaA6c1QL8lOINVAgOPkHuwPrrGHINjkB/cyJWj JX8AVaJnShzgH6Bw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D305B13A41; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8NogMiGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 25/29] ALSA: riptide: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:36 +0100 Message-Id: <20240207155140.18238-26-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.63 X-Spamd-Result: default: False [3.63 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.07)[62.59%] X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with an additional allocation of a flag without CONFIG_PM, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/riptide/riptide.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 9dee0345f22c..7e80686fb41a 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -448,9 +448,7 @@ struct snd_riptide { unsigned long received_irqs; unsigned long handled_irqs; -#ifdef CONFIG_PM_SLEEP int in_suspend; -#endif }; struct sgd { /* scatter gather desriptor */ @@ -1142,7 +1140,6 @@ static irqreturn_t riptide_handleirq(int irq, void *dev_id) return IRQ_HANDLED; } -#ifdef CONFIG_PM_SLEEP static int riptide_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -1166,11 +1163,7 @@ static int riptide_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(riptide_pm, riptide_suspend, riptide_resume); -#define RIPTIDE_PM_OPS &riptide_pm -#else -#define RIPTIDE_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(riptide_pm, riptide_suspend, riptide_resume); static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip) { @@ -2135,7 +2128,7 @@ static struct pci_driver driver = { .id_table = snd_riptide_ids, .probe = snd_card_riptide_probe, .driver = { - .pm = RIPTIDE_PM_OPS, + .pm = &riptide_pm, }, }; From patchwork Wed Feb 7 15:51:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548688 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 669D880BE8 for ; Wed, 7 Feb 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; cv=none; b=roRwOJ+rOz92xcD7vQPHUflJlsn1cV41NAsaaUMtVPCF3n9yq7PlrPnaVQ0X2AcTrFLOx/4T8WRalrlG4AMlhjpnM5S6dFUiaN4iuQrzMZvR+LhvZMX9vMh3OkE22JH5tzGs0T84phn1PuzkB34SgF929r7HDejCv8M3kZP9BuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; c=relaxed/simple; bh=zn2xnT5ktJlHbqaEKfKnqjynXEckUI9juZ5wJ9rQl5c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mPRXssKTfKXWBpWklXKFnLGK5TJjw1Uhwmco0dIaO5dyoGEa7dSsL72OvBXhg+0w7QWXzW2ctTwTpxs182G1t7OFc+gn9CpmV5y/QBIYiizj3VPv+DdfkNu4k9PTQsLu6BPoy5bdNtiinaED7i4Fg+P/e8GhOjtrdtHPIL6ZWOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=SXSTffIF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2Som04ng; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=SXSTffIF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2Som04ng; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="SXSTffIF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2Som04ng"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="SXSTffIF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2Som04ng" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 22389222CF; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V4KDZHUqFX6qBLv8U1utusalBfBNHsYYgHfcSmeeurQ=; b=SXSTffIFnwAjmGrbi4FqBFpVPCylq7WYZ6eX5qcKsy4/FxwMwLB74ZGrnLMiYG0cpp1JmP KLjrfqH2Chis1esy+jwX+TcdWMEiP5BbMd43e4NDpWLd1YZ5l8G730ML7A1JHkqKpkdPiL QCbawQ8qzPHNqZip6yYhJ/M68Ef9A4s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V4KDZHUqFX6qBLv8U1utusalBfBNHsYYgHfcSmeeurQ=; b=2Som04ngGbKSm2iopIuRWlN/K1Her70Qr5DCdSnCN9/tBaDCWYPxS0nEJs1BsInu5WNeoN 2nGPeU1mtzVYawAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V4KDZHUqFX6qBLv8U1utusalBfBNHsYYgHfcSmeeurQ=; b=SXSTffIFnwAjmGrbi4FqBFpVPCylq7WYZ6eX5qcKsy4/FxwMwLB74ZGrnLMiYG0cpp1JmP KLjrfqH2Chis1esy+jwX+TcdWMEiP5BbMd43e4NDpWLd1YZ5l8G730ML7A1JHkqKpkdPiL QCbawQ8qzPHNqZip6yYhJ/M68Ef9A4s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V4KDZHUqFX6qBLv8U1utusalBfBNHsYYgHfcSmeeurQ=; b=2Som04ngGbKSm2iopIuRWlN/K1Her70Qr5DCdSnCN9/tBaDCWYPxS0nEJs1BsInu5WNeoN 2nGPeU1mtzVYawAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 04CD4139D8; Wed, 7 Feb 2024 15:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id WGtbOyGnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:01 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 26/29] ALSA: rme96: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:37 +0100 Message-Id: <20240207155140.18238-27-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=SXSTffIF; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=2Som04ng X-Spamd-Result: default: False [4.69 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[34.01%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.69 X-Rspamd-Queue-Id: 22389222CF X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. The temporary buffers for PCM stream backups are conditionally allocated since the sizes aren't too small. Signed-off-by: Takashi Iwai --- sound/pci/rme96.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index 6b5ffb18197b..d50ad25574ad 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c @@ -220,12 +220,10 @@ struct rme96 { u8 rev; /* card revision number */ -#ifdef CONFIG_PM_SLEEP u32 playback_pointer; u32 capture_pointer; void *playback_suspend_buffer; void *capture_suspend_buffer; -#endif struct snd_pcm_substream *playback_substream; struct snd_pcm_substream *capture_substream; @@ -1543,10 +1541,8 @@ snd_rme96_free(struct rme96 *rme96) rme96->areg &= ~RME96_AR_DAC_EN; writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG); } -#ifdef CONFIG_PM_SLEEP vfree(rme96->playback_suspend_buffer); vfree(rme96->capture_suspend_buffer); -#endif } static void @@ -2329,8 +2325,6 @@ snd_rme96_create_switches(struct snd_card *card, * Card initialisation */ -#ifdef CONFIG_PM_SLEEP - static int rme96_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -2392,11 +2386,7 @@ static int rme96_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(rme96_pm, rme96_suspend, rme96_resume); -#define RME96_PM_OPS &rme96_pm -#else -#define RME96_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(rme96_pm, rme96_suspend, rme96_resume); static void snd_rme96_card_free(struct snd_card *card) { @@ -2432,14 +2422,14 @@ __snd_rme96_probe(struct pci_dev *pci, if (err) return err; -#ifdef CONFIG_PM_SLEEP - rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE); - if (!rme96->playback_suspend_buffer) - return -ENOMEM; - rme96->capture_suspend_buffer = vmalloc(RME96_BUFFER_SIZE); - if (!rme96->capture_suspend_buffer) - return -ENOMEM; -#endif + if (IS_ENABLED(CONFIG_PM_SLEEP)) { + rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE); + if (!rme96->playback_suspend_buffer) + return -ENOMEM; + rme96->capture_suspend_buffer = vmalloc(RME96_BUFFER_SIZE); + if (!rme96->capture_suspend_buffer) + return -ENOMEM; + } strcpy(card->driver, "Digi96"); switch (rme96->pci->device) { @@ -2483,7 +2473,7 @@ static struct pci_driver rme96_driver = { .id_table = snd_rme96_ids, .probe = snd_rme96_probe, .driver = { - .pm = RME96_PM_OPS, + .pm = &rme96_pm, }, }; From patchwork Wed Feb 7 15:51:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548680 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15BC07FBDC for ; Wed, 7 Feb 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=fWLyhc5P2R8cIJfdnCRNnd/JqIpqaFYtIhbmcAJ3kr/Y5Xdoc2GeuNjym9mqHWEyPVWgzEbyQDIND/rcyITvhPinovBKtQoS6cS9/+GoSynk2woZNBQvTjRVj9tfdTm8GzglQWMKZoaA3A+35nBZ50oT2v2OFsDtBGoOgNaG2rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=E/+76UeEkut8jxhwCVdgyUdUTx57aQfg4oF77neXrSk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OXeTq/lOneC6zFygzrD/BJa7FAw6+UNP6aCnNFMXNnjAxE1jOs33eLFJ/22kUbppfBbaDienJ0FwUUmREykyJBj+/5Gf5yr6A+8DQpOWceQUMeg1VVzPNgPSU4htBfTGIBvQq4aoWRH7PIZrZlupbh9OS+O79TPBcEA2TC5vD0k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WFlFU7rP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=HdTN0WHS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WFlFU7rP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=HdTN0WHS; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WFlFU7rP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="HdTN0WHS"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WFlFU7rP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="HdTN0WHS" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 517F222309; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qV4ChzjQFMPlmt38RsQ3MCYl5IxshswibUGUlRnpYHw=; b=WFlFU7rPYYoGkdL0p2OS06yAYS86nlrWSYOFCffZIa9o/Z8F5dbaJeEPJ7kEPrFQ/35RXR RKbnaHehKLKOzQEsEknrJXyjPEaE1nym/KcGfaxMTQpKQ1vO1wSn5amrTUAvws65q0M0lx FEHKL0Nv7dK4mVu/paxh6dYtbQnhBTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qV4ChzjQFMPlmt38RsQ3MCYl5IxshswibUGUlRnpYHw=; b=HdTN0WHSXfk9nftRqtVwXLEGNUQtwv15BGC805kOO3zzbEH7PEOmFg++Qy3txTB1EHDTA2 /oGG61J57kPR/HAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qV4ChzjQFMPlmt38RsQ3MCYl5IxshswibUGUlRnpYHw=; b=WFlFU7rPYYoGkdL0p2OS06yAYS86nlrWSYOFCffZIa9o/Z8F5dbaJeEPJ7kEPrFQ/35RXR RKbnaHehKLKOzQEsEknrJXyjPEaE1nym/KcGfaxMTQpKQ1vO1wSn5amrTUAvws65q0M0lx FEHKL0Nv7dK4mVu/paxh6dYtbQnhBTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qV4ChzjQFMPlmt38RsQ3MCYl5IxshswibUGUlRnpYHw=; b=HdTN0WHSXfk9nftRqtVwXLEGNUQtwv15BGC805kOO3zzbEH7PEOmFg++Qy3txTB1EHDTA2 /oGG61J57kPR/HAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2979713A41; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id SNe5CCKnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:02 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 27/29] ALSA: sis7019: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:38 +0100 Message-Id: <20240207155140.18238-28-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=WFlFU7rP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=HdTN0WHS X-Spamd-Result: default: False [4.64 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.05)[59.73%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.64 X-Rspamd-Queue-Id: 517F222309 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of all 4 pages no matter with CONFIG_PM, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/sis7019.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index fabe393607f8..53206beb2cb5 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c @@ -90,11 +90,7 @@ struct voice { * we're not doing power management, we still need to allocate a page * for the silence buffer. */ -#ifdef CONFIG_PM_SLEEP #define SIS_SUSPEND_PAGES 4 -#else -#define SIS_SUSPEND_PAGES 1 -#endif struct sis7019 { unsigned long ioport; @@ -1152,7 +1148,6 @@ static int sis_chip_init(struct sis7019 *sis) return 0; } -#ifdef CONFIG_PM_SLEEP static int sis_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -1231,11 +1226,7 @@ static int sis_resume(struct device *dev) return -EIO; } -static SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume); -#define SIS_PM_OPS &sis_pm -#else -#define SIS_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume); static int sis_alloc_suspend(struct sis7019 *sis) { @@ -1397,7 +1388,7 @@ static struct pci_driver sis7019_driver = { .id_table = snd_sis7019_ids, .probe = snd_sis7019_probe, .driver = { - .pm = SIS_PM_OPS, + .pm = &sis_pm, }, }; From patchwork Wed Feb 7 15:51:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548685 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54C2F8005D for ; Wed, 7 Feb 2024 15:52:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; cv=none; b=q+25FN03iI0FzBFrLwX/kJ/UkkBhySdoTd5zN3C/MBnqwe1Ky6eUIC5cMBDG+de2Zjzjzf8uB8teXUf7oLFjbOXppdMF3yFrXogeZ4Voqq3WER2ru8FReLvpJeXNCqFHnNB+hDAQwpSs/fIKMCQaOPjlX3NfJaPI+J7u7Ahigiw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321131; c=relaxed/simple; bh=LiGTHVfxQWmQFA39jq5dthx5eSYgVqWK1qRf8ZiuijI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q00ig8xtvDkew4+RipNOwooOFaxzYemue1h/BjutquLbz2I/zpuELvm1eTP235FfXvvN9Khi2yn7gYt39TT3+7fAnrBkSh5mShxQqirr7iPkZrm2tzJBLyAOpYPVaTb5tQ42FMfjmuCbJqeOybnXbdRKrrmEePVZ80baPh5WjHg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ilGHbvVe; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fCkiIYk7; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ilGHbvVe; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fCkiIYk7; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ilGHbvVe"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fCkiIYk7"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ilGHbvVe"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fCkiIYk7" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6B6352233A; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OO1Zz3kgy1EvVqAS2uodh90ZoX0RTFNfkVwA2IR3Vfk=; b=ilGHbvVehs3cCmA7/b0wJTwRIRncID+3NzQALSvLKza44Zy/P/boyt+PtZrdLLbkMfZYB5 NyGJA2n3Ms3TTsXVkW1AzxyVEmwnbzstDQ598UiTvlM1saTq4Ga1GY44d8BLsIwVz/rMY7 1e+F6XqFwKmqUv3FakraNDw4kfO7Fzs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OO1Zz3kgy1EvVqAS2uodh90ZoX0RTFNfkVwA2IR3Vfk=; b=fCkiIYk7gdKJMd9YRrpQc3Z+/G/GrILFJtfzx4quyTHlzgRIhpQyKB9DbaN9xh6jBRDeH6 dqFat+JhOtJdgcAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OO1Zz3kgy1EvVqAS2uodh90ZoX0RTFNfkVwA2IR3Vfk=; b=ilGHbvVehs3cCmA7/b0wJTwRIRncID+3NzQALSvLKza44Zy/P/boyt+PtZrdLLbkMfZYB5 NyGJA2n3Ms3TTsXVkW1AzxyVEmwnbzstDQ598UiTvlM1saTq4Ga1GY44d8BLsIwVz/rMY7 1e+F6XqFwKmqUv3FakraNDw4kfO7Fzs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OO1Zz3kgy1EvVqAS2uodh90ZoX0RTFNfkVwA2IR3Vfk=; b=fCkiIYk7gdKJMd9YRrpQc3Z+/G/GrILFJtfzx4quyTHlzgRIhpQyKB9DbaN9xh6jBRDeH6 dqFat+JhOtJdgcAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4EE10139B9; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id gCnWESKnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:02 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 28/29] ALSA: via82xx: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:39 +0100 Message-Id: <20240207155140.18238-29-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ilGHbvVe; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fCkiIYk7 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[25.55%] X-Spam-Score: -0.01 X-Rspamd-Queue-Id: 6B6352233A X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the state dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai --- sound/pci/via82xx.c | 15 ++------------- sound/pci/via82xx_modem.c | 9 ++------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index d8666ff7bdfa..89838b4fb118 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -347,13 +347,11 @@ struct via82xx { unsigned char old_legacy; unsigned char old_legacy_cfg; -#ifdef CONFIG_PM_SLEEP unsigned char legacy_saved; unsigned char legacy_cfg_saved; unsigned char spdif_ctrl_saved; unsigned char capture_src_saved[2]; unsigned int mpu_port_saved; -#endif unsigned char playback_volume[4][2]; /* for VIA8233/C/8235; default = 0 */ unsigned char playback_volume_c[2]; /* for VIA8233/C/8235; default = 0 */ @@ -2031,9 +2029,7 @@ static int snd_via686_init_misc(struct via82xx *chip) if (mpu_port >= 0x200) { /* force MIDI */ mpu_port &= 0xfffc; pci_write_config_dword(chip->pci, 0x18, mpu_port | 0x01); -#ifdef CONFIG_PM_SLEEP chip->mpu_port_saved = mpu_port; -#endif } else { mpu_port = pci_resource_start(chip->pci, 2); } @@ -2085,10 +2081,8 @@ static int snd_via686_init_misc(struct via82xx *chip) snd_via686_create_gameport(chip, &legacy); -#ifdef CONFIG_PM_SLEEP chip->legacy_saved = legacy; chip->legacy_cfg_saved = legacy_cfg; -#endif return 0; } @@ -2234,7 +2228,6 @@ static int snd_via82xx_chip_init(struct via82xx *chip) return 0; } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -2287,11 +2280,7 @@ static int snd_via82xx_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); -#define SND_VIA82XX_PM_OPS &snd_via82xx_pm -#else -#define SND_VIA82XX_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); static void snd_via82xx_free(struct snd_card *card) { @@ -2576,7 +2565,7 @@ static struct pci_driver via82xx_driver = { .id_table = snd_via82xx_ids, .probe = snd_via82xx_probe, .driver = { - .pm = SND_VIA82XX_PM_OPS, + .pm = &snd_via82xx_pm, }, }; diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index ca7f024bf8ec..a0a49b8d1511 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -1008,7 +1008,6 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip) return 0; } -#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -1042,11 +1041,7 @@ static int snd_via82xx_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); -#define SND_VIA82XX_PM_OPS &snd_via82xx_pm -#else -#define SND_VIA82XX_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); static void snd_via82xx_free(struct snd_card *card) { @@ -1168,7 +1163,7 @@ static struct pci_driver via82xx_modem_driver = { .id_table = snd_via82xx_modem_ids, .probe = snd_via82xx_probe, .driver = { - .pm = SND_VIA82XX_PM_OPS, + .pm = &snd_via82xx_pm, }, }; From patchwork Wed Feb 7 15:51:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13548681 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4ABA80048 for ; Wed, 7 Feb 2024 15:52:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; cv=none; b=G0TxxokIwMNlL+98uVC6v0UoyLDN0dzkoo92NA29CtAPjfztBAd/gDmVUo0tUHiWu49kRZ+mp8/tpZazGmrsUl0Fzn6O0itvPKt4sdo80bGV5eohnQSewGwiPvqIKBWgFmhXnfTaj7qX1ROPFtIyHyNQIeFthZTFiBFnD+Y86rc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707321129; c=relaxed/simple; bh=rTszBTSTZp3ezvcPYpCtkPre6eUqs/ETdFcNwwvxTAs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VcyTttVzCJtRbAiTHXOm4GAyGoC0AZUAfybyP83VX+I6D1lMLJhgMNdOIbNRU8kkX8LM7EXydrv8kRObUgUFp+mPb7Z2+fi7OghFqftuFfJVLpGwBJAsYiHxFqZO5u5pnmUedG1V/1HPEkdCebq36XfD5FR7Le6chh2FaWWLdJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=DJfFTxY7; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=6AJK2/l6; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=DJfFTxY7; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=6AJK2/l6; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="DJfFTxY7"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6AJK2/l6"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="DJfFTxY7"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6AJK2/l6" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8EFBF2233B; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jl5vFwEKDQH4SRKFEWfI7aT506q5QR8VeYf75bW0qW8=; b=DJfFTxY7wAc6RpmJWDP9d29o7uQfAfYZgvVX1u+xm2bBNdiuTX1WYQgfMawLsZliM2OfUv PliTNk9aLdITl1yFFkF7FNuR7+qnS3IJhCUuev76uMBO377TdkOFpj37D/C52YalvpbGmZ hUEyXIyN8/IX0XaqvSgSD2oV3ouWyb8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jl5vFwEKDQH4SRKFEWfI7aT506q5QR8VeYf75bW0qW8=; b=6AJK2/l6kZddT0LLu4Sfvzi3fWvm10kw4ktBTLJnQODaWKr+1IsXiFHPegN/31X7TaZeH4 hJUo0GsVYY52VRDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jl5vFwEKDQH4SRKFEWfI7aT506q5QR8VeYf75bW0qW8=; b=DJfFTxY7wAc6RpmJWDP9d29o7uQfAfYZgvVX1u+xm2bBNdiuTX1WYQgfMawLsZliM2OfUv PliTNk9aLdITl1yFFkF7FNuR7+qnS3IJhCUuev76uMBO377TdkOFpj37D/C52YalvpbGmZ hUEyXIyN8/IX0XaqvSgSD2oV3ouWyb8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707321122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jl5vFwEKDQH4SRKFEWfI7aT506q5QR8VeYf75bW0qW8=; b=6AJK2/l6kZddT0LLu4Sfvzi3fWvm10kw4ktBTLJnQODaWKr+1IsXiFHPegN/31X7TaZeH4 hJUo0GsVYY52VRDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 72A05139D8; Wed, 7 Feb 2024 15:52:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id aC6LGiKnw2UsRAAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 15:52:02 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 29/29] ALSA: doc: Use DEFINE_SIMPLE_DEV_PM_OPS() Date: Wed, 7 Feb 2024 16:51:40 +0100 Message-Id: <20240207155140.18238-30-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207155140.18238-1-tiwai@suse.de> References: <20240207155140.18238-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[22.82%] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for the example code. This allows us to drop CONFIG_PM_SLEEP ifdefs. While we're at it, expand the driver definition instead of passing directly via .driver.pm field. This seems to be a more common pattern. Signed-off-by: Takashi Iwai --- Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst index cd421856409e..2d2998faff62 100644 --- a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst +++ b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst @@ -3864,14 +3864,16 @@ corresponding destructor. And next, set suspend/resume callbacks to the pci_driver:: - static SIMPLE_DEV_PM_OPS(snd_my_pm_ops, mychip_suspend, mychip_resume); + static DEFINE_SIMPLE_DEV_PM_OPS(snd_my_pm_ops, mychip_suspend, mychip_resume); static struct pci_driver driver = { .name = KBUILD_MODNAME, .id_table = snd_my_ids, .probe = snd_my_probe, .remove = snd_my_remove, - .driver.pm = &snd_my_pm_ops, + .driver = { + .pm = &snd_my_pm_ops, + }, }; Module Parameters