From mboxrd@z Thu Jan 1 00:00:00 1970 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 4AC00C00140 for ; Mon, 8 Aug 2022 09:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241977AbiHHJfI (ORCPT ); Mon, 8 Aug 2022 05:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242335AbiHHJfH (ORCPT ); Mon, 8 Aug 2022 05:35:07 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A70EE3C for ; Mon, 8 Aug 2022 02:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659951301; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YpseGkLrpZAVP7fOwdfcO+7BapcohFVwFHbe+0bMW6w=; b=pAMgE7bE3JlIFhltQfJ1ixOZlS0cc0tX7KjAeRlJr69/wwwZtP+520sDFUzv52p6GgK5fV dGBsPiUdtJfc+nRWRQ5zhjtQbFEjS9sMVOd68oqtYYBVtt4V13t5Y49bDTNS2U50GPJ9RH 8jvKpdWxWKN9d9sO07D4zwdc8/bJE8I= Date: Mon, 08 Aug 2022 11:34:54 +0200 From: Paul Cercueil Subject: Re: [PATCH 4/6] iio: proximity: srf04: Use pm_ptr() to remove unused struct dev_pm_ops To: Andy Shevchenko Cc: Jonathan Cameron , linux-iio , Gwendal Grignou , Andreas Klinger , LI Qingwu , Mike Looijmans , Lorenzo Bianconi , Jonathan Cameron Message-Id: <6MIAGR.E5WEOO3MXOKZ2@crapouillou.net> In-Reply-To: References: <20220807185618.1038812-1-jic23@kernel.org> <20220807185618.1038812-5-jic23@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Hi Andy, Le lun., ao=FBt 8 2022 at 11:28:12 +0200, Andy Shevchenko=20 a =E9crit : > On Sun, Aug 7, 2022 at 8:46 PM Jonathan Cameron =20 > wrote: >>=20 >> From: Jonathan Cameron >>=20 >> If CONFIG_PM is not set, the pm_ptr() will ensure that the struct >> dev_pm_ops and callbacks are removed without the need for=20 >> __maybe_unused >> markings. >>=20 >> In this case we can't simply use DEFINE_RUNTIME_DEV_PM_OPS() because >> that would provide suspend and resume functions without the >> checks the driver is doing before calling runtime_pm functions >> (whether the necessary GPIO is provided). It may be possible to >> clean that up in future by moving the checks into the callbacks. >=20 > ... >=20 >> static const struct dev_pm_ops srf04_pm_ops =3D { >> - SET_RUNTIME_PM_OPS(srf04_pm_runtime_suspend, >> - srf04_pm_runtime_resume, NULL) >> + RUNTIME_PM_OPS(srf04_pm_runtime_suspend, >> + srf04_pm_runtime_resume, NULL) >> }; >=20 > static DEFINE_RUNTIME_DEV_PM_OPS(...); >=20 > ? Read the commit message? Cheers, -Paul