From patchwork Thu Dec 20 09:38:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 1016697 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ingics.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aYtSmi/a"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ingics-com.20150623.gappssmtp.com header.i=@ingics-com.20150623.gappssmtp.com header.b="V6H/psgf"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43L6Cc2N8Mz9sCh for ; Thu, 20 Dec 2018 20:39:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1DkUrJSl2g5tHiyIfXVElYSoyNX/Gw7E+jSyYaLf41s=; b=aYtSmi/ajSdZpT jVICI8ZznLCaUuaPzdOoBTmceOi9VXBcIg2SBQfk8qN5DQBhxYy1w9wJGKf8UDXBVX0fX+kG2la/J zbaDkdkfCfIcmvt0P+k1XVXDj8EdUilnesU//oZxN4o4f1cfztkFDblik+QCL+ahutQfMYc0c5HUQ rhiEtsB/b4R6K74KrUELnlhPWuhhACftMYDR+0qncc+hMEwyxKbLIkGfALWbvdBnqnSjyOF8w09eK auCgUYfZXdDGQp+lvYjXjbB4APjKhs73N2b9JPVOT46+hyIz151Gl8jLYeIw8sigDzDCtp2C3QCar v2fW4aKIhLhhCj6+d+4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZunF-0000rn-QQ; Thu, 20 Dec 2018 09:39:01 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZunB-0000qB-H3 for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 09:38:59 +0000 Received: by mail-pl1-x641.google.com with SMTP id u6so611196plm.8 for ; Thu, 20 Dec 2018 01:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1iUhDhIZ1xk9FGjJuaNFZaLpj2B2Rjon4JycLrDK7TY=; b=V6H/psgfubi2ZpcX1KcSuZloVb87/jIk1GnDUZsltHeipuJkZ8f1VCoPynfhff1c1c EjKaN2uhgMOBCosjaufOAgCgYu+yMrJTw9Pf8cSTV4+WQeQ7Robjx0IfkzT4wjLkjK4U KGCYr5aDhHM4RxbLQePEcLHD+B1gsIi0/R0dq4r0Zv/41Wa+iHcOGcyULZ4SIYksDuZY KmVajrBL/UhTdupusqU5tE8x0Udtj3Z+AY1gIP4Poke2NQKFmVR62BPjMyUcuHeQ+wRE la2b1qMCh8g2l0tE9y4v1ww1Of6sZQS8o6vv1HYgdDtPWAx2eJKawAOu9yhVD49y0c6R SDaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1iUhDhIZ1xk9FGjJuaNFZaLpj2B2Rjon4JycLrDK7TY=; b=OvxA+Jypwm0KdXD1O1wGwsLc/8DopQYFUo6EtGL2vCvrPAcGLP2/Zca0P2SHjM667V afdA02mtS8HWt47XgT7RnjOVhdxJX9zXPZ43m9ziGbXnPa4NdrQTYH9c+t/AaBhAJofd J6YLSTnXTuwEnuSfpPlwPpIWT9211w+HcKB9NjcPQF7+e09+TLGVgq0SXvmDrN3gQ56s iOIEQmH8uEKWLXmSLT5wInQUvjdJtZU18jitPGDsl6Y+j/CGWTiIgRqusDNAjLlUcsRF OU9aDTMEf6YQeYjySIHkJsofKc3TqfaYZoVM6FJq19A+lqMbnb2fMzXryJOlI/XNOw03 MkUA== X-Gm-Message-State: AA+aEWazHNGWWZ3GEIJv8ogyI23Kou6CNoyX6e2BNkUlsJptXCsba4gK lMp45o+22UDQrvLcDAUzORAtow== X-Google-Smtp-Source: AFSGD/U5p2Hoh5L4wPl040c5puKaXDHXPlrwcGXU2WsuUxZPDgnM90oglNVymgFW7rT5l7V7v45A/A== X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr23741384pld.8.1545298725645; Thu, 20 Dec 2018 01:38:45 -0800 (PST) Received: from localhost.localdomain (36-239-205-170.dynamic-ip.hinet.net. [36.239.205.170]) by smtp.gmail.com with ESMTPSA id j6sm32194261pfg.126.2018.12.20.01.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 01:38:44 -0800 (PST) From: Axel Lin To: Mark Brown Subject: [PATCH] regulator: mcp16502: Fix build error when !CONFIG_SUSPEND && CONFIG_PM_SLEEP Date: Thu, 20 Dec 2018 17:38:28 +0800 Message-Id: <20181220093828.28821-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_013858_217450_1F00B010 X-CRM114-Status: GOOD ( 11.96 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:641 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Axel Lin , Andrei Stefanescu , Liam Girdwood , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Use #ifdef CONFIG_PM_SLEEP guard around suspend_fn/resume_fn to fix below build error. CC [M] drivers/regulator/mcp16502.o In file included from ./include/linux/device.h:23:0, from ./include/linux/gpio/driver.h:5, from ./include/asm-generic/gpio.h:13, from ./include/linux/gpio.h:62, from drivers/regulator/mcp16502.c:11: drivers/regulator/mcp16502.c:528:32: error: ‘mcp16502_suspend_noirq’ undeclared here (not in a function); did you mean ‘mcp16502_suspend’? SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mcp16502_suspend_noirq, ^ ./include/linux/pm.h:342:19: note: in definition of macro ‘SET_NOIRQ_SYSTEM_SLEEP_PM_OPS’ .suspend_noirq = suspend_fn, \ ^~~~~~~~~~ drivers/regulator/mcp16502.c:529:10: error: ‘mcp16502_resume_noirq’ undeclared here (not in a function); did you mean ‘mcp16502_suspend_noirq’? mcp16502_resume_noirq) ^ ./include/linux/pm.h:343:18: note: in definition of macro ‘SET_NOIRQ_SYSTEM_SLEEP_PM_OPS’ .resume_noirq = resume_fn, \ ^~~~~~~~~ Signed-off-by: Axel Lin --- drivers/regulator/mcp16502.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c index ec5b6836a20c..2507acb7f5dc 100644 --- a/drivers/regulator/mcp16502.c +++ b/drivers/regulator/mcp16502.c @@ -498,7 +498,7 @@ static int mcp16502_probe(struct i2c_client *client, return 0; } -#ifdef CONFIG_SUSPEND +#ifdef CONFIG_PM_SLEEP static int mcp16502_suspend_noirq(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -518,10 +518,7 @@ static int mcp16502_resume_noirq(struct device *dev) return 0; } -#else /* !CONFIG_SUSPEND */ -#define mcp16502_suspend NULL -#define mcp16502_resume NULL -#endif /* !CONFIG_SUSPEND */ +#endif #ifdef CONFIG_PM static const struct dev_pm_ops mcp16502_pm_ops = {