Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1041452rwo; Sat, 22 Jul 2023 05:34:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZrPLD5qQtrV7mQXI8Wr/7kV7Pxn9w0x8BPT59l24fBGZI/uwMBuPJ49lSgZwW+sF5CVM4 X-Received: by 2002:a17:90a:9802:b0:25e:a87b:28cb with SMTP id z2-20020a17090a980200b0025ea87b28cbmr2784634pjo.25.1690029256152; Sat, 22 Jul 2023 05:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029256; cv=none; d=google.com; s=arc-20160816; b=PTLkVrtgGrJ3iozqdMQifC+YJ+V7W35/pBon2ZPU2wzJxoeWG35YJYBPlKmLgI53co i2X2kTeNMXrJN/RHsQmia1Ass8a2e/GILDTYH2LsWRd4gJ+tsKtBTBLLXYzfMkiemXaQ eYk9OFDwpgMqLkIwdA0z1O6To96pW4YhFuSfQ1nnZEdBebZR6LIe2ZgWPXEehDXeRPFu SDsrImskHrDAzBtdCtXun0I0g5pWuAXgIr8u3/yfU38XwyPNVZH2pJr0kGt5ALXhHeEo 2/FFwuMuH0DCA03w8yetIPZnDuSWUSt1UqlsMxHaLkXGX2PbDaPQq8uJY0mkofvofgVu yylg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZvEx+/bmIcBKo3sLB0qwnuNIHWgVCd4+TInDfv5ftPo=; fh=tvXSCzQIPyvEhl8hykCjRZprEE3wV7pJQstaNcGkesU=; b=NjRbveFp8oBr9fR3rxdtKRePZyz6ZTjeIGcgqqPvSLRHjzb7tuZPKCioJxhH3uf494 z6unZcYTnX+o4N53W21leWp2z4t7bAo9JEJHZpi5CsonlX974WEl60499KMifowxJqgj 1XBZ0fKCGqxDuICKpFiYp8Qi1hviC5Qr3SQJeT8OoDQTTE7sBtTuAok6iRrfJDz8peJu HC98GQmMl1BDaiAAgOmt8jgzYa03/5k3NsW1lZR7F7C/K4eoUJzrQ7fNkEwKBDlBsbzv 0KxQFqSCKEib9OHhMd59Qz+MXcQAuRchoRoLABHg8Zfonmywa7tTzST5xG2sYn9Z6VKa CYiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qUKoHoDn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a17090a4b0f00b00262cc36ea3esi5271574pjh.76.2023.07.22.05.34.03; Sat, 22 Jul 2023 05:34:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qUKoHoDn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjGVL7z (ORCPT + 99 others); Sat, 22 Jul 2023 07:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbjGVL7x (ORCPT ); Sat, 22 Jul 2023 07:59:53 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55FCB2D46; Sat, 22 Jul 2023 04:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZvEx+/bmIcBKo3sLB0qwnuNIHWgVCd4+TInDfv5ftPo=; b=qUKoHoDnUpbrNkx9bMwta1ALwle95h5zpiNJr+Vn9dD4RM8jXNsjuNgAxYos6Wax2kF4J0 MJ6Qk/NmPSTDRJcQNpx0QTOctzBL1seHDEkZyySLBBY3BxhbtqCifyYRBQn2D+EdVBGJpo 6JTFKp44RbAqBJ2ZOTlz9MnwoDtqeGE= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Viresh Kumar , Conghui Chen , virtualization@lists.linux-foundation.org Subject: [PATCH v2 21/22] i2c: virtio: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:53:09 +0200 Message-Id: <20230722115310.27681-5-paul@crapouillou.net> In-Reply-To: <20230722115046.27323-1-paul@crapouillou.net> References: <20230722115046.27323-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil Reviewed-by: Jonathan Cameron Acked-by: Viresh Kumar --- Cc: Conghui Chen Cc: Viresh Kumar Cc: virtualization@lists.linux-foundation.org --- drivers/i2c/busses/i2c-virtio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c index 4b9536f50800..c60ae531ba57 100644 --- a/drivers/i2c/busses/i2c-virtio.c +++ b/drivers/i2c/busses/i2c-virtio.c @@ -243,7 +243,6 @@ static struct virtio_device_id id_table[] = { }; MODULE_DEVICE_TABLE(virtio, id_table); -#ifdef CONFIG_PM_SLEEP static int virtio_i2c_freeze(struct virtio_device *vdev) { virtio_i2c_del_vqs(vdev); @@ -254,7 +253,6 @@ static int virtio_i2c_restore(struct virtio_device *vdev) { return virtio_i2c_setup_vqs(vdev->priv); } -#endif static const unsigned int features[] = { VIRTIO_I2C_F_ZERO_LENGTH_REQUEST, @@ -269,10 +267,8 @@ static struct virtio_driver virtio_i2c_driver = { .driver = { .name = "i2c_virtio", }, -#ifdef CONFIG_PM_SLEEP - .freeze = virtio_i2c_freeze, - .restore = virtio_i2c_restore, -#endif + .freeze = pm_sleep_ptr(virtio_i2c_freeze), + .restore = pm_sleep_ptr(virtio_i2c_restore), }; module_virtio_driver(virtio_i2c_driver); -- 2.40.1