From patchwork Mon Jan 2 18:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 639127 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 C8849C678D6 for ; Mon, 2 Jan 2023 18:07:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236362AbjABSH2 (ORCPT ); Mon, 2 Jan 2023 13:07:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236557AbjABSHM (ORCPT ); Mon, 2 Jan 2023 13:07:12 -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 85EC92E2 for ; Mon, 2 Jan 2023 10:07:10 -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 30E79B80DF0 for ; Mon, 2 Jan 2023 18:07:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF1B7C433EF; Mon, 2 Jan 2023 18:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672682827; bh=/FR+gxDCwvqrk6XzyZSWBM2i8Gaz+adNRvhAyRiFtTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WuYUrUIlsPHi0GB5L2YRQPoYtIu2V8tdE61tWioZp+bandgaDM8j9UTJKL+BFSLk/ nQX3T0bPauzUTPdX57bcFjsmumtj1PfhzTN86OVl83T+4uBxAbV73NxBI4C9JIq9w6 PRcMlsaBdFW3KkPMyvOZDGP6Gjchnj8PQWJzUxk1Z/+ER1EfKQamF6n0OihdSfUEfH KUV0A8kYQ/JSENNRtqUchitjbsMv6JrfcesuwhXdF6FDCS5Q2cegDw8Q2I/FPjP7at jxdWx6rhKiC4NnzPyi7xsJjB6i+SsLMh17yGiXPPCBGt8YlYLe2NAZR/hE7ZUxsbBD RjwGXFDQcNTQQ== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Vincent Knecht Subject: [PATCH 56/69] Input: msg2638 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Mon, 2 Jan 2023 18:18:29 +0000 Message-Id: <20230102181842.718010-57-jic23@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230102181842.718010-1-jic23@kernel.org> References: <20230102181842.718010-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Vincent Knecht --- drivers/input/touchscreen/msg2638.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/msg2638.c b/drivers/input/touchscreen/msg2638.c index 4c0816b09d33..b23db689d995 100644 --- a/drivers/input/touchscreen/msg2638.c +++ b/drivers/input/touchscreen/msg2638.c @@ -441,7 +441,7 @@ static int msg2638_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused msg2638_suspend(struct device *dev) +static int msg2638_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client); @@ -456,7 +456,7 @@ static int __maybe_unused msg2638_suspend(struct device *dev) return 0; } -static int __maybe_unused msg2638_resume(struct device *dev) +static int msg2638_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client); @@ -472,7 +472,7 @@ static int __maybe_unused msg2638_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume); static const struct msg_chip_data msg2138_data = { .irq_handler = msg2138_ts_irq_handler, @@ -495,7 +495,7 @@ static struct i2c_driver msg2638_ts_driver = { .probe_new = msg2638_ts_probe, .driver = { .name = "MStar-TS", - .pm = &msg2638_pm_ops, + .pm = pm_sleep_ptr(&msg2638_pm_ops), .of_match_table = msg2638_of_match, }, };