Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3837561rwb; Sun, 7 Aug 2022 08:23:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RircF85yD4XNmh8ALUj/AC4GcpfxkI7fCXN01EeE0gvjYG/lZZMj3EfHuv3lZi6g6PqYH X-Received: by 2002:a17:907:7e94:b0:730:aa9c:cb6a with SMTP id qb20-20020a1709077e9400b00730aa9ccb6amr10588016ejc.257.1659885786335; Sun, 07 Aug 2022 08:23:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659885786; cv=none; d=google.com; s=arc-20160816; b=OSfloWkbZMBMEbektiOJ4BTOT3KAk1jJ4pqNxr+jX/dPM11pX6Zljbq0ev//dRUIXL bNehe8gvN8wuKGw5BzmPtNY48klbxQQmmcoqoh3C2Z2RZm0FjqJk61Lpfy+aLG7IV6gu vSM4YkYwqBYiDpeXY+Aq2wBonhjt5/VqTI8chooJLsHF3s2C8xX9mUoKeH2EMicGdlA8 KfziyNExdMT50cmp98mf7RAizHLBctzV8ns2TG1VukoRP87M4ZjbTDqeo1gsRHzxGMTz vPT/HmIW+cMUUdAHJmlvi7ij4C7QOl58znQ0zVU9hryhEgu/dZQ+KyQtku4BWfRD85uL XM9Q== 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=HXAu1XJSjG1R6eydkrP6zVuUiYRS2CkOzAvRMGBTLfE=; b=Po9jmYk9x+LL9f14+xio230OF3/J9UZOLBifK/hQRJZ2sQo8SJSVrEZx6zpfnjxNmm 2JrQ9Dkovh4+lFYHWIZ/7ONvW60Sbz4ML46P1FsJRN2D3DscNtrjqhONqoiSQn3SsVqc tkrdOw2hmcDLlhTWX9MH5nbJ8mkU41b/2gYQItKuirn+QhlbA9gkkZG9wktHEnPscpHj 4KxMxutIIiw0OzU+m/WDTTt2DWayVGsB6wBiUCP7seunI++BGb4VjiyqvhdCoLAObUTb 57qvRUnAKDj2GELytoWMr6Vz10ixvGptwiAiwwasDFASJOBU/CWhXJfsWyhnH5ozvDvZ Dn+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=AkHEscQw; 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 u24-20020aa7d898000000b0043ece64ca45si3860534edq.111.2022.08.07.08.22.41; Sun, 07 Aug 2022 08:23:06 -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=AkHEscQw; 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 S234679AbiHGO5p (ORCPT + 99 others); Sun, 7 Aug 2022 10:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234743AbiHGO5O (ORCPT ); Sun, 7 Aug 2022 10:57:14 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A25B86B for ; Sun, 7 Aug 2022 07:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659883989; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HXAu1XJSjG1R6eydkrP6zVuUiYRS2CkOzAvRMGBTLfE=; b=AkHEscQwOGdm1+nXFH9oCx96DvkWzOQdGjZmGTPshn5wmWOf7S+Aq4rv1xyGPFTot6tDNq oYqq0YhwH6dLc1RBeH8QHA4v+OmhEmO7jQjdw/coWRlpvLBRUH016DdZrS2u80WJF5u5No XHQpF4m/4lzvTXNnjvbMp8vKhhbEOZA= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 28/28] mfd: tc6393xb: Remove #ifdef guards for PM related functions Date: Sun, 7 Aug 2022 16:52:47 +0200 Message-Id: <20220807145247.46107-29-paul@crapouillou.net> In-Reply-To: <20220807145247.46107-1-paul@crapouillou.net> References: <20220807145247.46107-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 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_sleep_ptr() macro to handle the .suspend/.resume callbacks. This macro allow the suspend and resume functions to be automatically dropped by the compiler when CONFIG_SUSPEND is disabled, without having to use #ifdef guards. The advantage is then that these functions are now always compiled independently of any Kconfig option, and thanks to that bugs and regressions are easier to catch. Signed-off-by: Paul Cercueil --- drivers/mfd/tc6393xb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index 0be5731685b4..9e1ecd92902c 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c @@ -814,7 +814,6 @@ static int tc6393xb_remove(struct platform_device *dev) return ret; } -#ifdef CONFIG_PM static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state) { struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); @@ -877,16 +876,12 @@ static int tc6393xb_resume(struct platform_device *dev) return 0; } -#else -#define tc6393xb_suspend NULL -#define tc6393xb_resume NULL -#endif static struct platform_driver tc6393xb_driver = { .probe = tc6393xb_probe, .remove = tc6393xb_remove, - .suspend = tc6393xb_suspend, - .resume = tc6393xb_resume, + .suspend = pm_sleep_ptr(tc6393xb_suspend), + .resume = pm_sleep_ptr(tc6393xb_resume), .driver = { .name = "tc6393xb", -- 2.35.1