Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1177759pxf; Fri, 12 Mar 2021 03:56:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKZmRVQ7dWi7ytOUisvPR+dgQ7sHFXIA1wiHLPKt7ewv/1HwKZDf7TaOkojrIYVwC+qZXD X-Received: by 2002:aa7:dbd3:: with SMTP id v19mr13504814edt.314.1615550216669; Fri, 12 Mar 2021 03:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615550216; cv=none; d=google.com; s=arc-20160816; b=XA3UjJmnJMGLGdI0RCLUP9k2nIgZIHq/CTibhXy8Kd9GoryfRNKVG/bzMSu2Q2kUSj kQ8yeacLsPiQny/v//V7glOFHSfya1Yuy2s8qGDXL1RuW+lGsIITtz9rMvaYyFKMn6BR ZwQXIXdC0UjDz+jR9FNlZFm5gEDQE/KwT3zAk9rHAu0qCUaNDpuWYxLqdXrndR+8IEt5 2aPGE1igFA6WMTMXgnoaWdBOHu+s2Fn+zsP2pd3oRWKs6pmvlTj0CylKD1io+FiAK8jN dC1PetEBFBp0SEqGwYFnOFPXUy1CQJrNBy3AmZeAejH2pa/WJYVcvU11ENrOHVFGHRUd IppQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=BfJXcClY5SWuajOCVotJOU0beBsi1AE3kA5YqGfUDLk=; b=p0qyT/RO2LcwAK0MbpSSLIDzyUCrRGhgwWTc1mcDNUJtzDVRnAFeIEaLWu2lECbimn XmnROq0RG27P/VAxiCD/JC2E+gByoRKs70sa6csZO0maF1lUINKLXCBGwYqa1/Wwzw9g mbapTiclc3bEzewFgWtu96A+06BdNmzrzhd62r++xkQfyd4Y4LcOS09MVxBi08VFv6Oc oHNrQia4jJa+a/PmeVKhWimWs58I3b1lNuQSuXTy9HBBnazOnj2dwFIkZaOJb18WrdyS fAIRju2yRbpic2Ie3dKiOTZKn6Kmp5tzbMnZlzsydA3o8UAyoabdR0M1ck4yDQBXnbvl PEMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=K37OZF+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx16si3707681ejb.344.2021.03.12.03.56.34; Fri, 12 Mar 2021 03:56:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=K37OZF+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231654AbhCLLxo (ORCPT + 99 others); Fri, 12 Mar 2021 06:53:44 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:51974 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbhCLLxi (ORCPT ); Fri, 12 Mar 2021 06:53:38 -0500 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12CBoTQ8009447; Fri, 12 Mar 2021 12:53:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=selector1; bh=BfJXcClY5SWuajOCVotJOU0beBsi1AE3kA5YqGfUDLk=; b=K37OZF+Y8tnuZ9oQvdyYNxIkDjNbBbq8zMsRH1mVRlPMT9JRcASrf3Y0LjVB14BGhhZ5 /OCAUem3niOJBEdDN4g8C5JI9l68bER3+ORr+PEjk8yQvky3+tuJrEyqXz64IFEolBB/ YHhtv0oDbd/nXw0fePk+A557O1rVJOuhZwqlvk9Ack69COYdDFcwbCWDkRbGy33iJjiw +ewDZBaqCujC+wNLG5Um5Y9Lbk9/9Hd2MzgFGxuo9weUe90t2U+0aSeM0F/HEVDR7Qrn 5LORTtNg3c9vgjxOMcE83gR/bFkKdg3LOtWWE7Y4JG41WA5O4asiGPr7Jtzz74fC01r+ rQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3741y7c7xf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Mar 2021 12:53:28 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 033BA10002A; Fri, 12 Mar 2021 12:53:27 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E28A52336D5; Fri, 12 Mar 2021 12:53:27 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 12 Mar 2021 12:53:27 +0100 From: Alain Volmat To: , CC: , , , , , , Subject: [PATCH] i2c: stm32f7: avoid ifdef CONFIG_PM_SLEEP for pm callbacks Date: Fri, 12 Mar 2021 12:53:27 +0100 Message-ID: <1615550007-10927-1-git-send-email-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE3.st.com (10.75.127.9) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-12_03:2021-03-10,2021-03-12 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid CONFIG_PM preprocessor check for pm suspend/resume callbacks and identify the functions with __maybe_unused. Signed-off-by: Alain Volmat --- drivers/i2c/busses/i2c-stm32f7.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index c62c815b88eb..4c2f1b16c5ce 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -2267,8 +2267,7 @@ static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev) +static int __maybe_unused stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev) { int ret; struct stm32f7_i2c_regs *backup_regs = &i2c_dev->backup_regs; @@ -2289,7 +2288,7 @@ static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev) return ret; } -static int stm32f7_i2c_regs_restore(struct stm32f7_i2c_dev *i2c_dev) +static int __maybe_unused stm32f7_i2c_regs_restore(struct stm32f7_i2c_dev *i2c_dev) { u32 cr1; int ret; @@ -2320,7 +2319,7 @@ static int stm32f7_i2c_regs_restore(struct stm32f7_i2c_dev *i2c_dev) return ret; } -static int stm32f7_i2c_suspend(struct device *dev) +static int __maybe_unused stm32f7_i2c_suspend(struct device *dev) { struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev); int ret; @@ -2341,7 +2340,7 @@ static int stm32f7_i2c_suspend(struct device *dev) return 0; } -static int stm32f7_i2c_resume(struct device *dev) +static int __maybe_unused stm32f7_i2c_resume(struct device *dev) { struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev); int ret; @@ -2361,7 +2360,6 @@ static int stm32f7_i2c_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops stm32f7_i2c_pm_ops = { SET_RUNTIME_PM_OPS(stm32f7_i2c_runtime_suspend, -- 2.17.1