From nobody Sat Apr 11 21:30:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1816C19F2A for ; Sun, 7 Aug 2022 14:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234752AbiHGO5s (ORCPT ); Sun, 7 Aug 2022 10:57:48 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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; } =20 -#ifdef CONFIG_PM static int tc6393xb_suspend(struct platform_device *dev, pm_message_t stat= e) { struct tc6393xb_platform_data *tcpd =3D dev_get_platdata(&dev->dev); @@ -877,16 +876,12 @@ static int tc6393xb_resume(struct platform_device *de= v) =20 return 0; } -#else -#define tc6393xb_suspend NULL -#define tc6393xb_resume NULL -#endif =20 static struct platform_driver tc6393xb_driver =3D { .probe =3D tc6393xb_probe, .remove =3D tc6393xb_remove, - .suspend =3D tc6393xb_suspend, - .resume =3D tc6393xb_resume, + .suspend =3D pm_sleep_ptr(tc6393xb_suspend), + .resume =3D pm_sleep_ptr(tc6393xb_resume), =20 .driver =3D { .name =3D "tc6393xb", --=20 2.35.1