From patchwork Sun Sep 25 17:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988051 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 9C7D8C54EE9 for ; Sun, 25 Sep 2022 17:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbiIYR3j (ORCPT ); Sun, 25 Sep 2022 13:29:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbiIYR3i (ORCPT ); Sun, 25 Sep 2022 13:29:38 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3708E26 for ; Sun, 25 Sep 2022 10:29:36 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 3C87BCE0E3F for ; Sun, 25 Sep 2022 17:29:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 151AEC433D7; Sun, 25 Sep 2022 17:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126973; bh=4OakupbKTJ0j38aQm6BHp3o3nPFW3nmpk3VSlmgcE90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HblNsseQ8U8/ipJ8X4OscR8Kf5/ArcNRQoAqtUGIBBqZbrt5f6ioHvM9LPuUVjvjA 8Fx2IH+71lTJT+6FX42LxUAlwbD+snRO0ATzFAgQYmGjTb5scIIKKfDFX5aY4OuxEZ QAG8O4H2wHiCpeT3jT8ZJVXXq4QCzhNuxeddxy7FPTfTq0tj9GHWNPhG7uS6DOtRss Bf/nbEtcaARy5BGaYOXaTBTKgnYQukJ16rC5msjBLUz5aTYd8BlM8KAlWkIB7UzHnZ CqJoqArgCoVyQO5SHqo4musy4K4ZNmY+a46Dyiutd3n4wiTB2CjDR9P6chQSBWl8wG UfNJfvwdECbbg== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 01/18] hwmon: (abitguru) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:42 +0100 Message-Id: <20220925172759.3573439-2-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers. Signed-off-by: Jonathan Cameron Cc: Hans de Goede --- drivers/hwmon/abituguru.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c index 681f0623868f..a7cae6568155 100644 --- a/drivers/hwmon/abituguru.c +++ b/drivers/hwmon/abituguru.c @@ -1504,7 +1504,6 @@ static struct abituguru_data *abituguru_update_device(struct device *dev) return NULL; } -#ifdef CONFIG_PM_SLEEP static int abituguru_suspend(struct device *dev) { struct abituguru_data *data = dev_get_drvdata(dev); @@ -1526,16 +1525,12 @@ static int abituguru_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume); -#define ABIT_UGURU_PM (&abituguru_pm) -#else -#define ABIT_UGURU_PM NULL -#endif /* CONFIG_PM */ +static DEFINE_SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume); static struct platform_driver abituguru_driver = { .driver = { .name = ABIT_UGURU_NAME, - .pm = ABIT_UGURU_PM, + .pm = pm_sleep_ptr(&abituguru_pm), }, .probe = abituguru_probe, .remove = abituguru_remove, From patchwork Sun Sep 25 17:27:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988052 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 0A609C04A95 for ; Sun, 25 Sep 2022 17:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232732AbiIYR3m (ORCPT ); Sun, 25 Sep 2022 13:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232159AbiIYR3l (ORCPT ); Sun, 25 Sep 2022 13:29:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2FA219D for ; Sun, 25 Sep 2022 10:29:38 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 02DD46154A for ; Sun, 25 Sep 2022 17:29:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C71DC433C1; Sun, 25 Sep 2022 17:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126977; bh=YToQx2h2DQCMGJCB7EgQVjDnap9gniTzdEwASV2fKuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgdz/3b1bnhI3GBUY3hxG909vh3ToYokBhI+BpcJbjytaeN64yLoPO/eBUx6FWhex 11srx25eqv4aOShpS5LlC+VobaGaM6h7ZEN2cPm2/yWp4FRPxVrCHciq7QXH7R4C6i qf9ViyPcIFXdj3P4qvvM/VfC+4B4FLbnKOyfcDRKLh66abwygWvArjl6J7Oy5savDP 4lKt9hD1jgvQj6aeS3/mu18lmb2DM1zUXXFGcMvrI3W2w1wBwJD3XDdIxR7EJZmKLN SZ2mfrsblPkVyH0JAxTB+HRjF/hGtxdZzfQoH5I0xyE/KhVWqTSOQcJGG1MCOMDWoD gPnWq9qs2GM9w== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 02/18] hwmon: (abitguru3) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:43 +0100 Message-Id: <20220925172759.3573439-3-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Hans de Goede --- drivers/hwmon/abituguru3.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index 8229ad30c909..afb21f73032d 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c @@ -1127,7 +1127,6 @@ static struct abituguru3_data *abituguru3_update_device(struct device *dev) return NULL; } -#ifdef CONFIG_PM_SLEEP static int abituguru3_suspend(struct device *dev) { struct abituguru3_data *data = dev_get_drvdata(dev); @@ -1146,16 +1145,12 @@ static int abituguru3_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(abituguru3_pm, abituguru3_suspend, abituguru3_resume); -#define ABIT_UGURU3_PM (&abituguru3_pm) -#else -#define ABIT_UGURU3_PM NULL -#endif /* CONFIG_PM */ +static DEFINE_SIMPLE_DEV_PM_OPS(abituguru3_pm, abituguru3_suspend, abituguru3_resume); static struct platform_driver abituguru3_driver = { .driver = { .name = ABIT_UGURU3_NAME, - .pm = ABIT_UGURU3_PM + .pm = pm_sleep_ptr(&abituguru3_pm), }, .probe = abituguru3_probe, .remove = abituguru3_remove, From patchwork Sun Sep 25 17:27:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988053 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 7ABC9C04A95 for ; Sun, 25 Sep 2022 17:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiIYR3o (ORCPT ); Sun, 25 Sep 2022 13:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231523AbiIYR3n (ORCPT ); Sun, 25 Sep 2022 13:29:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9949BC1B for ; Sun, 25 Sep 2022 10:29:42 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 46AB26154A for ; Sun, 25 Sep 2022 17:29:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED335C433B5; Sun, 25 Sep 2022 17:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126981; bh=t+f32U4mCYn82OJ5N8FI9jt8YtCfdyXt2g/ABpqP4JA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vc8jsTHdoZJwPp3yWRuCdzTHmfRcBJzEAEWWWgUmh9buL9gZk1t2LNVLy8o2/uDJt jcrjOOJOTIbIS7tjhILjXq+qBMVS7JEz0VXnX8d6klycwptmiiKVmu967b8XMnjHfX p//GJeR/B9Y0LBE6b4UppM/nRlddu//PCjYfiRrZw4YY3zOD6M20op1/pgBwVp8kQA z//E1p1JZnVlQ3YgDudEB1EqMkxxocBAOr5RCvXSJP2SSYyWz2c+nqXlufBOqpgzyv /XnK/8U6HWUXfTXxSuyuP0i9ja8AnM3RjABcsBZlgq0jPbW2LLy6PZ7V5puf111vwB Zc7sQIKiX/dbg== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 03/18] hwmon: (acpi_power_meter) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:44 +0100 Message-Id: <20220925172759.3573439-4-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Rafael J. Wysocki --- drivers/hwmon/acpi_power_meter.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index d2545a1be9fc..6d02947409d5 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -927,8 +927,6 @@ static int acpi_power_meter_remove(struct acpi_device *device) return 0; } -#ifdef CONFIG_PM_SLEEP - static int acpi_power_meter_resume(struct device *dev) { struct acpi_power_meter_resource *resource; @@ -946,9 +944,8 @@ static int acpi_power_meter_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ - -static SIMPLE_DEV_PM_OPS(acpi_power_meter_pm, NULL, acpi_power_meter_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(acpi_power_meter_pm, NULL, + acpi_power_meter_resume); static struct acpi_driver acpi_power_meter_driver = { .name = "power_meter", @@ -959,7 +956,7 @@ static struct acpi_driver acpi_power_meter_driver = { .remove = acpi_power_meter_remove, .notify = acpi_power_meter_notify, }, - .drv.pm = &acpi_power_meter_pm, + .drv.pm = pm_sleep_ptr(&acpi_power_meter_pm), }; /* Module init/exit routines */ From patchwork Sun Sep 25 17:27:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988054 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 92823C54EE9 for ; Sun, 25 Sep 2022 17:29:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbiIYR3t (ORCPT ); Sun, 25 Sep 2022 13:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbiIYR3r (ORCPT ); Sun, 25 Sep 2022 13:29:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ADA9DF5A for ; Sun, 25 Sep 2022 10:29:46 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 17C89614F3 for ; Sun, 25 Sep 2022 17:29:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 296C9C433D6; Sun, 25 Sep 2022 17:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126985; bh=lOY5B9NQqMbtLf1sBXQgbZXnB1gCWESMzarj6dO+VNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HV6Mxn/A7EdW2IXyUN5VS/tPWweiicEkaKTluYQL/CuEYrjeyvWZtI5bPT6EX4b5Q ALMOZVsDCiDq8Zxpf2r+sGvJU5Gt3GsQ7mdH7Apf6n0sHQJqpQHZyAWYp4gfqGKX5t 9OO9n0gfTZMKUD9ZkJPz7HFGv49mbw2xMRQRcLt+MtiKPLH6cE3AWdy/4y4plWwpNX UdTLMbzKat2YJ3ZO+RAduUvD6MF0WELc951tqeXIyvfw3tsLgfcRMK1J1VPDehdpwp xLypew6XOkXlS+GziYkOfToKxG0r1WUav/C0moZFkmtTAWtK//VbQ3vKafOdT//aYy 60gT1hMZyo2Kw== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 04/18] hwmon: (adt7x10) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:45 +0100 Message-Id: <20220925172759.3573439-5-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/hwmon/adt7310.c | 2 +- drivers/hwmon/adt7410.c | 2 +- drivers/hwmon/adt7x10.c | 7 +------ drivers/hwmon/adt7x10.h | 5 ----- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/hwmon/adt7310.c b/drivers/hwmon/adt7310.c index 1efc0bdcceab..067865f4887a 100644 --- a/drivers/hwmon/adt7310.c +++ b/drivers/hwmon/adt7310.c @@ -152,7 +152,7 @@ MODULE_DEVICE_TABLE(spi, adt7310_id); static struct spi_driver adt7310_driver = { .driver = { .name = "adt7310", - .pm = ADT7X10_DEV_PM_OPS, + .pm = pm_sleep_ptr(&adt7x10_dev_pm_ops), }, .probe = adt7310_spi_probe, .id_table = adt7310_id, diff --git a/drivers/hwmon/adt7410.c b/drivers/hwmon/adt7410.c index aede5baca7b9..0cebf6777239 100644 --- a/drivers/hwmon/adt7410.c +++ b/drivers/hwmon/adt7410.c @@ -98,7 +98,7 @@ static struct i2c_driver adt7410_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "adt7410", - .pm = ADT7X10_DEV_PM_OPS, + .pm = pm_sleep_ptr(&adt7x10_dev_pm_ops), }, .probe_new = adt7410_i2c_probe, .id_table = adt7410_ids, diff --git a/drivers/hwmon/adt7x10.c b/drivers/hwmon/adt7x10.c index ce54bffab2ec..da67734edafd 100644 --- a/drivers/hwmon/adt7x10.c +++ b/drivers/hwmon/adt7x10.c @@ -397,8 +397,6 @@ int adt7x10_probe(struct device *dev, const char *name, int irq, } EXPORT_SYMBOL_GPL(adt7x10_probe); -#ifdef CONFIG_PM_SLEEP - static int adt7x10_suspend(struct device *dev) { struct adt7x10_data *data = dev_get_drvdata(dev); @@ -414,10 +412,7 @@ static int adt7x10_resume(struct device *dev) return regmap_write(data->regmap, ADT7X10_CONFIG, data->config); } -SIMPLE_DEV_PM_OPS(adt7x10_dev_pm_ops, adt7x10_suspend, adt7x10_resume); -EXPORT_SYMBOL_GPL(adt7x10_dev_pm_ops); - -#endif /* CONFIG_PM_SLEEP */ +EXPORT_SIMPLE_DEV_PM_OPS(adt7x10_dev_pm_ops, adt7x10_suspend, adt7x10_resume); MODULE_AUTHOR("Hartmut Knaack"); MODULE_DESCRIPTION("ADT7410/ADT7420, ADT7310/ADT7320 common code"); diff --git a/drivers/hwmon/adt7x10.h b/drivers/hwmon/adt7x10.h index ba22c32c8355..46caf3e21978 100644 --- a/drivers/hwmon/adt7x10.h +++ b/drivers/hwmon/adt7x10.h @@ -20,11 +20,6 @@ struct device; int adt7x10_probe(struct device *dev, const char *name, int irq, struct regmap *regmap); -#ifdef CONFIG_PM_SLEEP extern const struct dev_pm_ops adt7x10_dev_pm_ops; -#define ADT7X10_DEV_PM_OPS (&adt7x10_dev_pm_ops) -#else -#define ADT7X10_DEV_PM_OPS NULL -#endif #endif From patchwork Sun Sep 25 17:27:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988055 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 1764AC54EE9 for ; Sun, 25 Sep 2022 17:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233222AbiIYRaC (ORCPT ); Sun, 25 Sep 2022 13:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232963AbiIYR35 (ORCPT ); Sun, 25 Sep 2022 13:29:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80FD517587 for ; Sun, 25 Sep 2022 10:29:52 -0700 (PDT) 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 0423DB80DE2 for ; Sun, 25 Sep 2022 17:29:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EEEDC433C1; Sun, 25 Sep 2022 17:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126989; bh=4R0AFM/i//wKykpTJIPJ6rvdy9ZhhhqxgjeMhrj6IAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=enm5EPH2ME8nUFaQAePqO7vJDXHtcsuUZdsUuvTLQgwEMTglmcqjgW26/AuyszxHL JerxJ9EI6Uspcr5tcmSs4UIHedHx/iEnLEefyfseojx3HZY5wZbl97EChnW2/MfHt5 UO5jq7zoL6DSgF8MWv6BjM63TFoxtk244aCTZ3FtWWgYZ//eyRSvDvKtjnQ0gnV/MW YQgK5spFSslPcha59B63QXFQqGpvhARLi/yyBqSj85OukeqiVNsbF9Tp8o3FKHFmhY un5rWvMQlH31KBuj0zMYH/VqxJGOb1OGBnCDUmWXbfdnrwyizOsE5BLGXesZv5FL5D 72g7ka5bmFg0w== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 05/18] hwmon: (gpio-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:46 +0100 Message-Id: <20220925172759.3573439-6-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Linus Walleij --- drivers/hwmon/gpio-fan.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index fbf3f5a4ecb6..b05aedd20b4f 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -557,7 +557,6 @@ static void gpio_fan_shutdown(struct platform_device *pdev) set_fan_speed(fan_data, 0); } -#ifdef CONFIG_PM_SLEEP static int gpio_fan_suspend(struct device *dev) { struct gpio_fan_data *fan_data = dev_get_drvdata(dev); @@ -580,18 +579,14 @@ static int gpio_fan_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume); -#define GPIO_FAN_PM (&gpio_fan_pm) -#else -#define GPIO_FAN_PM NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume); static struct platform_driver gpio_fan_driver = { .probe = gpio_fan_probe, .shutdown = gpio_fan_shutdown, .driver = { .name = "gpio-fan", - .pm = GPIO_FAN_PM, + .pm = pm_sleep_ptr(&gpio_fan_pm), .of_match_table = of_match_ptr(of_gpio_fan_match), }, }; From patchwork Sun Sep 25 17:27:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988056 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 2CE4BC04A95 for ; Sun, 25 Sep 2022 17:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232940AbiIYRaF (ORCPT ); Sun, 25 Sep 2022 13:30:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233195AbiIYRaA (ORCPT ); Sun, 25 Sep 2022 13:30:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E82178AA for ; Sun, 25 Sep 2022 10:29:54 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 47446614F3 for ; Sun, 25 Sep 2022 17:29:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F3DCC4314C; Sun, 25 Sep 2022 17:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126993; bh=Gp003LvB+6K2HgRspjYrH6YT8jx8F5kMBuvXWbfKmIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hB83SSLPfNOLH0/XohL22dIOhAbK78thq+EDyeWBK1kNg0d5nZzTaCk/G7vkTheuM /3MVIkWgCLV479Kf8z53VoOwnTeKupAEu0BdG15vxCwWlF+6fzQfF9AKK/MiZVPtXe irp6LLFdX+xaTsxEnvwPZm6XdgdaP7ZdolAaZFcGz3FFA3fr4eq5TBWD7CkHJrvugj c38Fr77P6R168Ry0L+IbZDW8Qw/gyCeln8M1mml2Jm82+cX5TB4ho5x6AtdOKlValD 7I6xfoN/9OMOqkGE39eNw2l9LaFVO1YE3FjSwOvBjIVlEQfZ2onjYnxjDYqK22lViF DLCbPNmnss7RQ== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 06/18] hwmon: (it87) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:47 +0100 Message-Id: <20220925172759.3573439-7-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/it87.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 0e543dbe0a6b..7bd154ba351b 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -3179,7 +3179,7 @@ static int it87_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(hwmon_dev); } -static void __maybe_unused it87_resume_sio(struct platform_device *pdev) +static void it87_resume_sio(struct platform_device *pdev) { struct it87_data *data = dev_get_drvdata(&pdev->dev); int err; @@ -3211,7 +3211,7 @@ static void __maybe_unused it87_resume_sio(struct platform_device *pdev) superio_exit(data->sioaddr); } -static int __maybe_unused it87_resume(struct device *dev) +static int it87_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct it87_data *data = dev_get_drvdata(dev); @@ -3238,12 +3238,12 @@ static int __maybe_unused it87_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(it87_dev_pm_ops, NULL, it87_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(it87_dev_pm_ops, NULL, it87_resume); static struct platform_driver it87_driver = { .driver = { .name = DRVNAME, - .pm = &it87_dev_pm_ops, + .pm = pm_sleep_ptr(&it87_dev_pm_ops), }, .probe = it87_probe, }; From patchwork Sun Sep 25 17:27:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988057 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 44F15C54EE9 for ; Sun, 25 Sep 2022 17:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbiIYRaN (ORCPT ); Sun, 25 Sep 2022 13:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233185AbiIYRaC (ORCPT ); Sun, 25 Sep 2022 13:30:02 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8055F5B2 for ; Sun, 25 Sep 2022 10:30:00 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 06D82CE0E3E for ; Sun, 25 Sep 2022 17:29:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24E86C433D6; Sun, 25 Sep 2022 17:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664126997; bh=pt622bbiC9ahFfPJ5C6A9+86qKoF9GtjvEZiIJsjCeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INBr3AEvPb1k7y7ueDPWfTVdnQ9wwK+LTQU27P2z3aoYjQrfsHgWXbIIIms7HCs4I y+a122OVisk0da1RsTMWZqr31OxOTtgmCRC4Emn3v5/BVMdzKFksZtXDF8xc6MKrV1 X44p9kZeUcMT4vdoQqBHuDl2C2K6SK2j0UosLrdBhSXm6mOCPuJsUknbhmjAZxh42U 2aGwH9tXi5DLYsqz87PAgQiIgpB6UCVpGLF22xS9JONtEl2nqbtLYVi18/d/Ve8JcE bBzAIBaP3wtBn45QiZH5F3GseB6uyvIkI7wX5/ZeHsmbgcXbI+mZ9kxdFSvZwXvDuC lnetfxTC0GkLg== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 07/18] hwmon: (lm90) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:48 +0100 Message-Id: <20220925172759.3573439-8-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Guenter Roeck --- drivers/hwmon/lm90.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index c151c0bf43f2..db595f7d01f8 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -2956,7 +2956,7 @@ static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type, } } -static int __maybe_unused lm90_suspend(struct device *dev) +static int lm90_suspend(struct device *dev) { struct lm90_data *data = dev_get_drvdata(dev); struct i2c_client *client = data->client; @@ -2967,7 +2967,7 @@ static int __maybe_unused lm90_suspend(struct device *dev) return 0; } -static int __maybe_unused lm90_resume(struct device *dev) +static int lm90_resume(struct device *dev) { struct lm90_data *data = dev_get_drvdata(dev); struct i2c_client *client = data->client; @@ -2978,14 +2978,14 @@ static int __maybe_unused lm90_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(lm90_pm_ops, lm90_suspend, lm90_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(lm90_pm_ops, lm90_suspend, lm90_resume); static struct i2c_driver lm90_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "lm90", .of_match_table = of_match_ptr(lm90_of_match), - .pm = &lm90_pm_ops, + .pm = pm_sleep_ptr(&lm90_pm_ops), }, .probe_new = lm90_probe, .alert = lm90_alert, From patchwork Sun Sep 25 17:27:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988058 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 10C48C04A95 for ; Sun, 25 Sep 2022 17:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232680AbiIYRaO (ORCPT ); Sun, 25 Sep 2022 13:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233167AbiIYRaF (ORCPT ); Sun, 25 Sep 2022 13:30:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1D8178A9 for ; Sun, 25 Sep 2022 10:30:03 -0700 (PDT) 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 8BB4AB80682 for ; Sun, 25 Sep 2022 17:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9C2BC433C1; Sun, 25 Sep 2022 17:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127001; bh=pkSIsmB94NCXe1l9JmhDKpuUYsLhipQdkUdQTiBi9c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9kQEU7ayZOl6aP09emB+05jmxunC5q/3O0ySaLIkQztEjsiW8AZ4qHuDhl6R/6PV edCJHyC40elbhd60QNAhOYvpqEvx91BOcqIfe7KLhmw+Wll59xwMSgFUZRlc47W9DJ K38jiQFebjo3iF2QMJrK82Z042FOgg+Hb/y/wGa/w/aUp/CJwG5UMqxjtxejbk9YBZ D45vsJTzIgUBt1zwmE/J9KGs2OK/M6pdU6n1F2qV64IusA0hA4Gt5o9+EzGGO3NSy4 hUcw8+tczBpFbFIKYqhhe48pEGNp5hno5hCjYKlEQGl4sbg2Kya7EGGpIW24baMgW8 uo2/IqThqFK+g== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 08/18] hwmon: (ltc2947) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:49 +0100 Message-Id: <20220925172759.3573439-9-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. In this case it also lets the structure itself be removed. Signed-off-by: Jonathan Cameron Cc: Nuno Sá --- drivers/hwmon/ltc2947-core.c | 7 +++---- drivers/hwmon/ltc2947-i2c.c | 2 +- drivers/hwmon/ltc2947-spi.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/ltc2947-core.c b/drivers/hwmon/ltc2947-core.c index 626f5bf2c9c7..7404e974762f 100644 --- a/drivers/hwmon/ltc2947-core.c +++ b/drivers/hwmon/ltc2947-core.c @@ -1120,7 +1120,7 @@ int ltc2947_core_probe(struct regmap *map, const char *name) } EXPORT_SYMBOL_GPL(ltc2947_core_probe); -static int __maybe_unused ltc2947_resume(struct device *dev) +static int ltc2947_resume(struct device *dev) { struct ltc2947_data *st = dev_get_drvdata(dev); u32 ctrl = 0; @@ -1149,7 +1149,7 @@ static int __maybe_unused ltc2947_resume(struct device *dev) LTC2947_CONT_MODE_MASK, LTC2947_CONT_MODE(1)); } -static int __maybe_unused ltc2947_suspend(struct device *dev) +static int ltc2947_suspend(struct device *dev) { struct ltc2947_data *st = dev_get_drvdata(dev); @@ -1157,8 +1157,7 @@ static int __maybe_unused ltc2947_suspend(struct device *dev) LTC2947_SHUTDOWN_MASK, 1); } -SIMPLE_DEV_PM_OPS(ltc2947_pm_ops, ltc2947_suspend, ltc2947_resume); -EXPORT_SYMBOL_GPL(ltc2947_pm_ops); +EXPORT_SIMPLE_DEV_PM_OPS(ltc2947_pm_ops, ltc2947_suspend, ltc2947_resume); const struct of_device_id ltc2947_of_match[] = { { .compatible = "adi,ltc2947" }, diff --git a/drivers/hwmon/ltc2947-i2c.c b/drivers/hwmon/ltc2947-i2c.c index ad0dfd3efbf8..96852bc8a964 100644 --- a/drivers/hwmon/ltc2947-i2c.c +++ b/drivers/hwmon/ltc2947-i2c.c @@ -36,7 +36,7 @@ static struct i2c_driver ltc2947_driver = { .driver = { .name = "ltc2947", .of_match_table = ltc2947_of_match, - .pm = <c2947_pm_ops, + .pm = pm_sleep_ptr(<c2947_pm_ops), }, .probe_new = ltc2947_probe, .id_table = ltc2947_id, diff --git a/drivers/hwmon/ltc2947-spi.c b/drivers/hwmon/ltc2947-spi.c index c24ca569db1b..a33be110098c 100644 --- a/drivers/hwmon/ltc2947-spi.c +++ b/drivers/hwmon/ltc2947-spi.c @@ -38,7 +38,7 @@ static struct spi_driver ltc2947_driver = { .driver = { .name = "ltc2947", .of_match_table = ltc2947_of_match, - .pm = <c2947_pm_ops, + .pm = pm_sleep_ptr(<c2947_pm_ops), }, .probe = ltc2947_probe, .id_table = ltc2947_id, From patchwork Sun Sep 25 17:27:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988059 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 B853EC6FA8E for ; Sun, 25 Sep 2022 17:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232707AbiIYRaP (ORCPT ); Sun, 25 Sep 2022 13:30:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbiIYRaI (ORCPT ); Sun, 25 Sep 2022 13:30:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E259E19005 for ; Sun, 25 Sep 2022 10:30:06 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id BAF5460B60 for ; Sun, 25 Sep 2022 17:30:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB34FC433D7; Sun, 25 Sep 2022 17:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127005; bh=hYmNKLciLIcxsn36wSGifB1hsmIsXIJi5Pye0aqxgmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkV+nQYfqwYkQeNsKe3bGJniU0Tg1L8XME0eW4JgEyJmX6kViRP9bXdyPmdh+sV/O hreI3Ue/1RJa1h+niTVH5kKV9Ddcef8LMvV6vtLryHx6uMx5hjYTbl/fOOObDeOR/U BsllYSyZWbKWVPfEqooyGEyMO7vxbp7JjlPMZlfn1RnTTElWnkGa83uMcO35fBqc84 AYmDJO2H5ZpDhuHRgRTbWVGxshgLKJYYCIfpBzh27W4C7Gys2NXWx5SZ8IUq8PC1NH yv5ro+F+L/J0UuvjmY/y5uGFZ0DuVMEPdi8kBEmFM7D7ni0RhRgr8QtSH5+xXxfodO TboCTpUjNr4TQ== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 09/18] hwmon: (max31722) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:50 +0100 Message-Id: <20220925172759.3573439-10-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/max31722.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/max31722.c b/drivers/hwmon/max31722.c index 93e048ee4955..9a31ef388396 100644 --- a/drivers/hwmon/max31722.c +++ b/drivers/hwmon/max31722.c @@ -113,7 +113,7 @@ static void max31722_remove(struct spi_device *spi) dev_warn(&spi->dev, "Failed to put device in stand-by mode\n"); } -static int __maybe_unused max31722_suspend(struct device *dev) +static int max31722_suspend(struct device *dev) { struct spi_device *spi_device = to_spi_device(dev); struct max31722_data *data = spi_get_drvdata(spi_device); @@ -121,7 +121,7 @@ static int __maybe_unused max31722_suspend(struct device *dev) return max31722_set_mode(data, MAX31722_MODE_STANDBY); } -static int __maybe_unused max31722_resume(struct device *dev) +static int max31722_resume(struct device *dev) { struct spi_device *spi_device = to_spi_device(dev); struct max31722_data *data = spi_get_drvdata(spi_device); @@ -129,7 +129,7 @@ static int __maybe_unused max31722_resume(struct device *dev) return max31722_set_mode(data, MAX31722_MODE_CONTINUOUS); } -static SIMPLE_DEV_PM_OPS(max31722_pm_ops, max31722_suspend, max31722_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max31722_pm_ops, max31722_suspend, max31722_resume); static const struct spi_device_id max31722_spi_id[] = { {"max31722", 0}, @@ -141,7 +141,7 @@ MODULE_DEVICE_TABLE(spi, max31722_spi_id); static struct spi_driver max31722_driver = { .driver = { .name = "max31722", - .pm = &max31722_pm_ops, + .pm = pm_sleep_ptr(&max31722_pm_ops), }, .probe = max31722_probe, .remove = max31722_remove, From patchwork Sun Sep 25 17:27:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988060 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 263B5C04A95 for ; Sun, 25 Sep 2022 17:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbiIYRaQ (ORCPT ); Sun, 25 Sep 2022 13:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233191AbiIYRaL (ORCPT ); Sun, 25 Sep 2022 13:30:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5D75DF5A for ; Sun, 25 Sep 2022 10:30:09 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 828B960B60 for ; Sun, 25 Sep 2022 17:30:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0117C433D6; Sun, 25 Sep 2022 17:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127008; bh=zUkDP8H67QtBqYJLbhzwD9s9c4QRsHFH6Z2cc6W1OO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kDCBcfFqKBUFR78ymtzWVUkwuyC54SEENCUISXGwNMmPhXJHoW1s2b5VeeL7YwnwF pgCQ/XekoQMttD1pesrLNoR8CFjFZRW31Eygfzv/7UJNNJh7FTFM262aOHIN5O6JO0 9hghgpOWZJtEoD68RPSupIkcLf4ScLFwR1PdNnz5mzXZONlD7dBNe0ZlnslHqzIVUx xxW0O40HH0Lu5sASToied8vXmP/USHAKvDycaTKd3lOWTv1dY93jj7maKHn2Lt2Uam Z1/I/U9jJP6WUqPrUNaVmL11VbRyf3ciRI0GQIqceZFh9rREg7fL6hL6kyCUjAGWfF plw2WmpF4/ZVw== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 10/18] hwmon: (max31730) witch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:51 +0100 Message-Id: <20220925172759.3573439-11-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Guenter Roeck --- drivers/hwmon/max31730.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/max31730.c b/drivers/hwmon/max31730.c index 9bdff881f59c..746a767c9fc6 100644 --- a/drivers/hwmon/max31730.c +++ b/drivers/hwmon/max31730.c @@ -404,28 +404,28 @@ static int max31730_detect(struct i2c_client *client, return 0; } -static int __maybe_unused max31730_suspend(struct device *dev) +static int max31730_suspend(struct device *dev) { struct max31730_data *data = dev_get_drvdata(dev); return max31730_write_config(data, MAX31730_STOP, 0); } -static int __maybe_unused max31730_resume(struct device *dev) +static int max31730_resume(struct device *dev) { struct max31730_data *data = dev_get_drvdata(dev); return max31730_write_config(data, 0, MAX31730_STOP); } -static SIMPLE_DEV_PM_OPS(max31730_pm_ops, max31730_suspend, max31730_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max31730_pm_ops, max31730_suspend, max31730_resume); static struct i2c_driver max31730_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "max31730", .of_match_table = of_match_ptr(max31730_of_match), - .pm = &max31730_pm_ops, + .pm = pm_sleep_ptr(&max31730_pm_ops), }, .probe_new = max31730_probe, .id_table = max31730_ids, From patchwork Sun Sep 25 17:27:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988061 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 DF601C54EE9 for ; Sun, 25 Sep 2022 17:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232675AbiIYRaS (ORCPT ); Sun, 25 Sep 2022 13:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232985AbiIYRaR (ORCPT ); Sun, 25 Sep 2022 13:30:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45151DF5A for ; Sun, 25 Sep 2022 10:30:15 -0700 (PDT) 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 D19E8B81366 for ; Sun, 25 Sep 2022 17:30:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CE3DC433D7; Sun, 25 Sep 2022 17:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127012; bh=OE1ncISOjmOPCpTKxd6MjYis+R8dh6UFMC2w0wD0pQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PtWICk2+N6AA6DvfAXYsp3NPyPUz94+/V8M22y+xwLAEqvtU2Gs8m3IwKpWrgU7qP I5lb21k5I4kUWeaQ7/8pP+PJK2zAUu8gZ5QmW7eiHjghdZ8JCMO+sZReAhvhEFXRqy zeHWheSzjNOsPudGjV/vcC35HiHNBrQacqe4QG2PQrqyIGN1GAuGjB3DGDeXTPLZxi J4f55TPjh1iOr9Hu4PjpuAc5Qw8YTOTRX2sBIPAdy3lx/yl3oFXkb0sia8mTXqC5Nc XHqC8Fugnilp1YysjaReS5StpVIcHvjjJwVh4YtpgJ4J//y7TLlYKjiLucbyL0McxP jkHmDkdTao1fA== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 11/18] hwmon: (max6639) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:52 +0100 Message-Id: <20220925172759.3573439-12-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of #ifdef guards whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Roland Stigge --- drivers/hwmon/max6639.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c index 936861131d74..9b895402c80d 100644 --- a/drivers/hwmon/max6639.c +++ b/drivers/hwmon/max6639.c @@ -571,7 +571,6 @@ static int max6639_probe(struct i2c_client *client) return PTR_ERR_OR_ZERO(hwmon_dev); } -#ifdef CONFIG_PM_SLEEP static int max6639_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -609,7 +608,6 @@ static int max6639_resume(struct device *dev) return i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG, ret & ~MAX6639_GCONFIG_STANDBY); } -#endif /* CONFIG_PM_SLEEP */ static const struct i2c_device_id max6639_id[] = { {"max6639", 0}, @@ -618,13 +616,13 @@ static const struct i2c_device_id max6639_id[] = { MODULE_DEVICE_TABLE(i2c, max6639_id); -static SIMPLE_DEV_PM_OPS(max6639_pm_ops, max6639_suspend, max6639_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max6639_pm_ops, max6639_suspend, max6639_resume); static struct i2c_driver max6639_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "max6639", - .pm = &max6639_pm_ops, + .pm = pm_sleep_ptr(&max6639_pm_ops), }, .probe_new = max6639_probe, .id_table = max6639_id, From patchwork Sun Sep 25 17:27:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988062 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 A216EC6FA82 for ; Sun, 25 Sep 2022 17:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbiIYRaT (ORCPT ); Sun, 25 Sep 2022 13:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbiIYRaS (ORCPT ); Sun, 25 Sep 2022 13:30:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 533642182B for ; Sun, 25 Sep 2022 10:30:17 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C354B614F3 for ; Sun, 25 Sep 2022 17:30:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F23FFC433D6; Sun, 25 Sep 2022 17:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127016; bh=gOO0EmLnme3sUtILSsI4WKvOsYnbjS7ZhnDDnsRutjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jxj0sjq8Q/OaVNaQmMp/lcYpItIa8ev9DdT9N0sT2JE8f4CkZHU7Vxzg4LsUdiuRo N9rQMNeS4U4gJKet+RlkpzCxysMz9KMXJIf1cuRhiTouBhq/OR3wd90tGgPX9OAgET VBXaMhh/2XWF99yeaOKLjwattD3IDD9cnmMtvjq85ZusWMy6bqRH/9DzQ/QhYBhGhj qNetiyJxQZyUnxcTEDl0pE30qiZF/BNqYjnbDbJnNvSzv/MaJ0Pf59kS0JgMxObLu2 5/R4xSniOVb4380MAQ9ILYZ5N2bHRugJ7ddR2AStRO9mN6BMFggBXODbg2HkwnxZtE DapJ9J8KAFUdQ== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 12/18] hwmon: (nct6775) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:53 +0100 Message-Id: <20220925172759.3573439-13-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Zoltán Kővágó --- drivers/hwmon/nct6775-platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c index 41c97cfacfb8..b34783784213 100644 --- a/drivers/hwmon/nct6775-platform.c +++ b/drivers/hwmon/nct6775-platform.c @@ -355,7 +355,7 @@ static void nct6791_enable_io_mapping(struct nct6775_sio_data *sio_data) } } -static int __maybe_unused nct6775_suspend(struct device *dev) +static int nct6775_suspend(struct device *dev) { int err; u16 tmp; @@ -386,7 +386,7 @@ static int __maybe_unused nct6775_suspend(struct device *dev) return err; } -static int __maybe_unused nct6775_resume(struct device *dev) +static int nct6775_resume(struct device *dev) { struct nct6775_data *data = dev_get_drvdata(dev); struct nct6775_sio_data *sio_data = dev_get_platdata(dev); @@ -467,7 +467,7 @@ static int __maybe_unused nct6775_resume(struct device *dev) return err; } -static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume); static void nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio_data) @@ -934,7 +934,7 @@ static int nct6775_platform_probe(struct platform_device *pdev) static struct platform_driver nct6775_driver = { .driver = { .name = DRVNAME, - .pm = &nct6775_dev_pm_ops, + .pm = pm_sleep_ptr(&nct6775_dev_pm_ops), }, .probe = nct6775_platform_probe, }; From patchwork Sun Sep 25 17:27:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988063 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 59D31C54EE9 for ; Sun, 25 Sep 2022 17:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbiIYRaX (ORCPT ); Sun, 25 Sep 2022 13:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232357AbiIYRaW (ORCPT ); Sun, 25 Sep 2022 13:30:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 506ED25C74 for ; Sun, 25 Sep 2022 10:30:21 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 8F8C9614F3 for ; Sun, 25 Sep 2022 17:30:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5D61C433D7; Sun, 25 Sep 2022 17:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127020; bh=cGtLAp3FXPmI68SsrzNVUnFbX/pPpXH4K4sebNDScnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GTZR8NSVYqqFStip60MpDZvq9fmgYb8QCPk8jJU1ndf9aX8pV8IRu5o3mxkUQv74m OmUO2be/IVyfh8gT+7kOq6/SEhU2ZM4yszJhk4mK1NeV8DR8jVi5rk5DKwrQZGCrCk XgKc6YWlEKFW2dUfLCZFMnbIq0cmDyU1w51hB39J9YLFes1kBXYGClHxj5hbG868LR /7M+9+19CQ4RlddpaIKqpALR6nej7fZ25Mgka8eC0KKUApmPMZkY1nLZXoOtYhgseD wDI3iE+CP/e82KdJuJ2G3yHe8lVGHN7/gefN40E24DKBeUSLP+VEU8uQH/8avNBl+s xdcRQy3a6zf6Q== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 13/18] hwmon: (pwm-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:54 +0100 Message-Id: <20220925172759.3573439-14-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of #ifdef guards whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/pwm-fan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 498128eb81f1..dc3d9a22d917 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -639,7 +639,6 @@ static void pwm_fan_shutdown(struct platform_device *pdev) pwm_fan_cleanup(ctx); } -#ifdef CONFIG_PM_SLEEP static int pwm_fan_suspend(struct device *dev) { struct pwm_fan_ctx *ctx = dev_get_drvdata(dev); @@ -653,9 +652,8 @@ static int pwm_fan_resume(struct device *dev) return set_pwm(ctx, ctx->pwm_value); } -#endif -static SIMPLE_DEV_PM_OPS(pwm_fan_pm, pwm_fan_suspend, pwm_fan_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pwm_fan_pm, pwm_fan_suspend, pwm_fan_resume); static const struct of_device_id of_pwm_fan_match[] = { { .compatible = "pwm-fan", }, @@ -668,7 +666,7 @@ static struct platform_driver pwm_fan_driver = { .shutdown = pwm_fan_shutdown, .driver = { .name = "pwm-fan", - .pm = &pwm_fan_pm, + .pm = pm_sleep_ptr(&pwm_fan_pm), .of_match_table = of_pwm_fan_match, }, }; From patchwork Sun Sep 25 17:27:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988064 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 8F8C3C04A95 for ; Sun, 25 Sep 2022 17:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbiIYRa1 (ORCPT ); Sun, 25 Sep 2022 13:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232770AbiIYRa0 (ORCPT ); Sun, 25 Sep 2022 13:30:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02FD528712 for ; Sun, 25 Sep 2022 10:30:25 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 921F0614F3 for ; Sun, 25 Sep 2022 17:30:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A41C6C433C1; Sun, 25 Sep 2022 17:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127024; bh=xQO5Ol4D2yOlu2yUhafnHBfqvXcDNSfSPwc3AeZZOy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qavarunn2eJlWeKhzidAr07bejW6rz5Mg4tYiOzzr1s3oXEiG4ps/TCUjGID+t51x iOOYvb2hI16U1mw5OR/WbCvW2haqQ6VA8Bx6W4M6SUgCtefr9FOyCAUZuMJC+AZVdz rPzDA03HE3qAvF+YNp+JRS4daFyKaYH0PcEge1IqbzXZjCKm3Cmx0t/p0/Y3Q3n/zN D+zR9IGlB8zciafYkh2/9qc9uOeWoOG3Krdo/B4QkgImChVpAOS9yTBmmdkK57yiSJ zdDAG0AJgcmzmW4tArsQnNg1JCAj2C7b0ZMINU7FNSbcjIr6rYaX9338Qe5oFWDUQT diSxKWQ67pKPQ== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 14/18] hwmon: (tmp102) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:55 +0100 Message-Id: <20220925172759.3573439-15-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of #ifdef guards whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/tmp102.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c index e867a0c2e539..2bf496a62206 100644 --- a/drivers/hwmon/tmp102.c +++ b/drivers/hwmon/tmp102.c @@ -260,7 +260,6 @@ static int tmp102_probe(struct i2c_client *client) return 0; } -#ifdef CONFIG_PM_SLEEP static int tmp102_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -283,9 +282,8 @@ static int tmp102_resume(struct device *dev) return err; } -#endif /* CONFIG_PM */ -static SIMPLE_DEV_PM_OPS(tmp102_dev_pm_ops, tmp102_suspend, tmp102_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(tmp102_dev_pm_ops, tmp102_suspend, tmp102_resume); static const struct i2c_device_id tmp102_id[] = { { "tmp102", 0 }, @@ -302,7 +300,7 @@ MODULE_DEVICE_TABLE(of, tmp102_of_match); static struct i2c_driver tmp102_driver = { .driver.name = DRIVER_NAME, .driver.of_match_table = of_match_ptr(tmp102_of_match), - .driver.pm = &tmp102_dev_pm_ops, + .driver.pm = pm_sleep_ptr(&tmp102_dev_pm_ops), .probe_new = tmp102_probe, .id_table = tmp102_id, }; From patchwork Sun Sep 25 17:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988065 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 B5DDCC04A95 for ; Sun, 25 Sep 2022 17:30:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231258AbiIYRac (ORCPT ); Sun, 25 Sep 2022 13:30:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232142AbiIYRa3 (ORCPT ); Sun, 25 Sep 2022 13:30:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 160182C108 for ; Sun, 25 Sep 2022 10:30:29 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id A64EF60B60 for ; Sun, 25 Sep 2022 17:30:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2E4AC433D6; Sun, 25 Sep 2022 17:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127028; bh=GgEN4+iiUbdZYI8aRA+ZzKku9A5SKs7sBVH80uhu37k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uoB2vObZgcHLjyEP/Rb2nplb7NKp/2sHcUjMixav7ZrVTdmkToNl6yrbxn63Pk6TD C9rtO+TkF26WgpDWMBiNnni3v8/zM2qfuNDGaXxxyofjlLl0ECI5smHTD0Of32Eeem c0kLlNp2pKRKOXUTh+xA3Fni5AHjiHofQlCGipL+N3sCbLAWCqJD0tnpEgv11KSAXy /ZtKw6TJLgUTAATlbL89H5wL9z12LausBaEVZzZ1WGvJZkhm1QvANxAJCRHfSJwtLw VhfOnKriFF+U6SS22aUTAfcGXv0ZBRzXfJoilXtOhZY3FDAtpEHUujGxEHqPRCOZmi f7Y6YQBxJUUPQ== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 15/18] hwmon: (tmp103) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:56 +0100 Message-Id: <20220925172759.3573439-16-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/tmp103.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/tmp103.c b/drivers/hwmon/tmp103.c index 5cab4436aa77..56d5cbf36a45 100644 --- a/drivers/hwmon/tmp103.c +++ b/drivers/hwmon/tmp103.c @@ -178,7 +178,7 @@ static int tmp103_probe(struct i2c_client *client) return PTR_ERR_OR_ZERO(hwmon_dev); } -static int __maybe_unused tmp103_suspend(struct device *dev) +static int tmp103_suspend(struct device *dev) { struct regmap *regmap = dev_get_drvdata(dev); @@ -186,7 +186,7 @@ static int __maybe_unused tmp103_suspend(struct device *dev) TMP103_CONF_SD_MASK, 0); } -static int __maybe_unused tmp103_resume(struct device *dev) +static int tmp103_resume(struct device *dev) { struct regmap *regmap = dev_get_drvdata(dev); @@ -194,7 +194,7 @@ static int __maybe_unused tmp103_resume(struct device *dev) TMP103_CONF_SD_MASK, TMP103_CONF_SD); } -static SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume); static const struct i2c_device_id tmp103_id[] = { { "tmp103", 0 }, @@ -212,7 +212,7 @@ static struct i2c_driver tmp103_driver = { .driver = { .name = "tmp103", .of_match_table = of_match_ptr(tmp103_of_match), - .pm = &tmp103_dev_pm_ops, + .pm = pm_sleep_ptr(&tmp103_dev_pm_ops), }, .probe_new = tmp103_probe, .id_table = tmp103_id, From patchwork Sun Sep 25 17:27:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988066 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 02825C54EE9 for ; Sun, 25 Sep 2022 17:30:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232142AbiIYRag (ORCPT ); Sun, 25 Sep 2022 13:30:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbiIYRaf (ORCPT ); Sun, 25 Sep 2022 13:30:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D026FAC8 for ; Sun, 25 Sep 2022 10:30:34 -0700 (PDT) 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 2BBDCB80781 for ; Sun, 25 Sep 2022 17:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8804BC433D7; Sun, 25 Sep 2022 17:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127031; bh=SU2SxwDcc9OV58DOiDFiwRjWQAilQbpi/QvLz9VnqLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I1A4VhrRIsmN9twEP3G8EVynvqauzG2WPpKEDMYCamftBJ8MuP8n07QDC/NBMQRe3 9rgQ/ST0VEIs3p8AZTguVlSfOw8CSUlyWlZHK+8d3IZtVXyCM/WHm8dWLoTHDoGaJx JT/B9sll1fEYU5sA5Zs9H9EdahXf20IFuKNgjgfYvlvDro2OqYxYE2k3G1x8vrOjJJ RxGyNtTvGUq5cV0Jfc7UuCiOW63AEKb2vWQqZICx9RVaEqtxwO0M29OrOylGtYhWqM h99evTJamWxK+jd4upf5s4TNyUiD1vpRnpO+eYeNs1qOoq75RqVTXTvklphOdAX3ee 11i6CwIoM+xog== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 16/18] hwmon: (tmp108) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:57 +0100 Message-Id: <20220925172759.3573439-17-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/tmp108.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c index 5435664c3f6e..acb4ba750b09 100644 --- a/drivers/hwmon/tmp108.c +++ b/drivers/hwmon/tmp108.c @@ -390,7 +390,7 @@ static int tmp108_probe(struct i2c_client *client) return PTR_ERR_OR_ZERO(hwmon_dev); } -static int __maybe_unused tmp108_suspend(struct device *dev) +static int tmp108_suspend(struct device *dev) { struct tmp108 *tmp108 = dev_get_drvdata(dev); @@ -398,7 +398,7 @@ static int __maybe_unused tmp108_suspend(struct device *dev) TMP108_CONF_MODE_MASK, TMP108_MODE_SHUTDOWN); } -static int __maybe_unused tmp108_resume(struct device *dev) +static int tmp108_resume(struct device *dev) { struct tmp108 *tmp108 = dev_get_drvdata(dev); int err; @@ -410,7 +410,7 @@ static int __maybe_unused tmp108_resume(struct device *dev) return err; } -static SIMPLE_DEV_PM_OPS(tmp108_dev_pm_ops, tmp108_suspend, tmp108_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(tmp108_dev_pm_ops, tmp108_suspend, tmp108_resume); static const struct i2c_device_id tmp108_i2c_ids[] = { { "tmp108", 0 }, @@ -429,7 +429,7 @@ MODULE_DEVICE_TABLE(of, tmp108_of_ids); static struct i2c_driver tmp108_driver = { .driver = { .name = DRIVER_NAME, - .pm = &tmp108_dev_pm_ops, + .pm = pm_sleep_ptr(&tmp108_dev_pm_ops), .of_match_table = of_match_ptr(tmp108_of_ids), }, .probe_new = tmp108_probe, From patchwork Sun Sep 25 17:27:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988067 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 44AB5C04A95 for ; Sun, 25 Sep 2022 17:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbiIYRam (ORCPT ); Sun, 25 Sep 2022 13:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbiIYRaj (ORCPT ); Sun, 25 Sep 2022 13:30:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64AF2FAC8 for ; Sun, 25 Sep 2022 10:30:38 -0700 (PDT) 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 0DC9CB80781 for ; Sun, 25 Sep 2022 17:30:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54C71C433D6; Sun, 25 Sep 2022 17:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127035; bh=2kjoerhpXfg+NexEYY87iubJXRqM4+FWfSG0glVHnLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M14BOskZzd33iscKMlhMD7tj0OGl7IytV8KjK4aDxjZpHCHWi9ga3e52fm4lwz2V9 ls0NUhKYp1B0Zr0YA9uM30meZh9pB8oPE2u2D+1fBC0iVyBtFKHWQTaUud0Belxrj4 hEKE71UrW91ItP070P+hmnAS3Mb/bcFalAQfT1LZDQDZlYJzDKVpre1iQ2ZR6pTQmp a7AuDZFL2VTg3UNGfE0tk/bHGimh8jT0bfvhxpxSj7+gYHTdHAlfO5LScDPemiz+X1 w8GMDp6MorJzm84b88sGWK8DKdg8nWPNgyadUsiGuarbK6yeEnmH2ut4NA7q+nk2ST bb4fqW81y+Giw== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 17/18] hwmon: (w83627ehf) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Sun, 25 Sep 2022 18:27:58 +0100 Message-Id: <20220925172759.3573439-18-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron --- drivers/hwmon/w83627ehf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index af89b32a93a5..939d4c35e713 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c @@ -1944,7 +1944,7 @@ static int __init w83627ehf_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(hwmon_dev); } -static int __maybe_unused w83627ehf_suspend(struct device *dev) +static int w83627ehf_suspend(struct device *dev) { struct w83627ehf_data *data = w83627ehf_update_device(dev); @@ -1955,7 +1955,7 @@ static int __maybe_unused w83627ehf_suspend(struct device *dev) return 0; } -static int __maybe_unused w83627ehf_resume(struct device *dev) +static int w83627ehf_resume(struct device *dev) { struct w83627ehf_data *data = dev_get_drvdata(dev); int i; @@ -2010,12 +2010,12 @@ static int __maybe_unused w83627ehf_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(w83627ehf_dev_pm_ops, w83627ehf_suspend, w83627ehf_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(w83627ehf_dev_pm_ops, w83627ehf_suspend, w83627ehf_resume); static struct platform_driver w83627ehf_driver = { .driver = { .name = DRVNAME, - .pm = &w83627ehf_dev_pm_ops, + .pm = pm_sleep_ptr(&w83627ehf_dev_pm_ops), }, }; From patchwork Sun Sep 25 17:27:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12988068 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 36771C6FA82 for ; Sun, 25 Sep 2022 17:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbiIYRam (ORCPT ); Sun, 25 Sep 2022 13:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiIYRal (ORCPT ); Sun, 25 Sep 2022 13:30:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A880D25C74 for ; Sun, 25 Sep 2022 10:30:40 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 43A7F60B60 for ; Sun, 25 Sep 2022 17:30:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39DE9C43470; Sun, 25 Sep 2022 17:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664127039; bh=h7qKZT0gGt2oPhVaiwbxaSbl60WJQy6McOhI6760anM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z2+I9XDrGH6MBN9jNRHYF9kMHDaSl2qKQ4DswJYjIFoEychpMpDvm/7ezAfcEZA8m T6Fh0B9l/xcWxqzs6qw3rOEfcMib0/VPownJupY9Ado+NW1dxYHmHgRPRkG/oNeNPP naX9jqlUnnmdtsSfdB6fTMG1ptfoJoTVyRKJWTkM4ss1/UhYqKmLVXAAnuSi5PT65F DWszYTHqJS5F/096S3SM8SrBh8c8RXN/qwO3iuBrd8HPQT2lwpY41/QgHVH+65PJit TC+uipbD+t/4dxR1kDAK6PW/gNI2OxwW4VQT2YoSQw0zjvy1txkKH4o8OxASE/9qDu bUlxpe0hJ+QFw== From: Jonathan Cameron To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Paul Cercueil , Hans de Goede , "Rafael J . Wysocki" , Lars-Peter Clausen , Linus Walleij , =?utf-8?q?Nuno_S=C3=A1?= , Roland Stigge , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= , Ninad Malwade , Jonathan Cameron Subject: [PATCH 18/18] hwmon: (ina3221) Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() Date: Sun, 25 Sep 2022 18:27:59 +0100 Message-Id: <20220925172759.3573439-19-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220925172759.3573439-1-jic23@kernel.org> References: <20220925172759.3573439-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Jonathan Cameron These new macros allow the compiler to see all the functions even if !CONFIG_PM* and remove the structures and functions if unused. This removes the need for __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Ninad Malwade --- drivers/hwmon/ina3221.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c index 58d3828e2ec0..8ef2631fc312 100644 --- a/drivers/hwmon/ina3221.c +++ b/drivers/hwmon/ina3221.c @@ -930,7 +930,7 @@ static int ina3221_remove(struct i2c_client *client) return 0; } -static int __maybe_unused ina3221_suspend(struct device *dev) +static int ina3221_suspend(struct device *dev) { struct ina3221_data *ina = dev_get_drvdata(dev); int ret; @@ -953,7 +953,7 @@ static int __maybe_unused ina3221_suspend(struct device *dev) return 0; } -static int __maybe_unused ina3221_resume(struct device *dev) +static int ina3221_resume(struct device *dev) { struct ina3221_data *ina = dev_get_drvdata(dev); int ret; @@ -996,11 +996,8 @@ static int __maybe_unused ina3221_resume(struct device *dev) return 0; } -static const struct dev_pm_ops ina3221_pm = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(ina3221_suspend, ina3221_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(ina3221_pm, ina3221_suspend, ina3221_resume, + NULL); static const struct of_device_id ina3221_of_match_table[] = { { .compatible = "ti,ina3221", }, @@ -1020,7 +1017,7 @@ static struct i2c_driver ina3221_i2c_driver = { .driver = { .name = INA3221_DRIVER_NAME, .of_match_table = ina3221_of_match_table, - .pm = &ina3221_pm, + .pm = pm_ptr(&ina3221_pm), }, .id_table = ina3221_ids, };