From patchwork Sun Jan 30 19:31:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12729979 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 574B5C433EF for ; Sun, 30 Jan 2022 19:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355895AbiA3T0D (ORCPT ); Sun, 30 Jan 2022 14:26:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355893AbiA3T0C (ORCPT ); Sun, 30 Jan 2022 14:26:02 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53C7FC061714 for ; Sun, 30 Jan 2022 11:26:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BEDB3B829AA for ; Sun, 30 Jan 2022 19:25:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04259C340EF; Sun, 30 Jan 2022 19:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643570758; bh=qr/QTUL36RyykG43Oqzt3hdy+RDjKKItR9LQpopDoeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J5YOn6aaEKu2b2TDYYoMJkbh9KgMeZbOOV9CmVovauCFeJtuvaxhFL6FmdqE4LUjn VJk3/6ZORbrIuovWSlp5DuVvCyGPvbsW/ZQ3vSyOGloCcAPIfohHUVnXlciCYSWGKg a2CYMKB+9rc4MeW6ECMZYIa51C3r+Qf+ICDVgqVpqxET74wLS8ukVmUVYWVTeo+Y8v IrFrT0o9UpVaTFuoSqmJPJog6ZK6e+wfkS9vx7iUBtYDi+KAyYIr05bBUmv/3E6Hy0 G5Nh+jU6x2Hj1GYUHHxJGwrSG4C7SCHC/KZaW9dkwBL4Oxt3NJYVPqKB413/ggw/LU VMOp484yAFEDA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Paul Cercueil , Arnd Bergmann , "Rafael J . Wysocki" , Jonathan Cameron , Krzysztof Kozlowski Subject: [PATCH v3 11/50] iio:adc:exynos_adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Date: Sun, 30 Jan 2022 19:31:08 +0000 Message-Id: <20220130193147.279148-12-jic23@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220130193147.279148-1-jic23@kernel.org> References: <20220130193147.279148-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based config guards. Removing instances of this approach from IIO also stops them being copied into new drivers. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jonathan Cameron --- drivers/iio/adc/exynos_adc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index 3b3868aa2533..cff1ba57fb16 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -968,7 +968,6 @@ static int exynos_adc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int exynos_adc_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); @@ -1001,11 +1000,9 @@ static int exynos_adc_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(exynos_adc_pm_ops, - exynos_adc_suspend, - exynos_adc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(exynos_adc_pm_ops, exynos_adc_suspend, + exynos_adc_resume); static struct platform_driver exynos_adc_driver = { .probe = exynos_adc_probe, @@ -1013,7 +1010,7 @@ static struct platform_driver exynos_adc_driver = { .driver = { .name = "exynos-adc", .of_match_table = exynos_adc_match, - .pm = &exynos_adc_pm_ops, + .pm = pm_sleep_ptr(&exynos_adc_pm_ops), }, };