From patchwork Wed Oct 16 14:16:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 176482 Delivered-To: patches@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7229833ocf; Wed, 16 Oct 2019 07:16:32 -0700 (PDT) X-Received: by 2002:a19:f013:: with SMTP id p19mr3369618lfc.98.1571235392006; Wed, 16 Oct 2019 07:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571235392; cv=none; d=google.com; s=arc-20160816; b=fz/LY8NjSpepsMgf0pnaAvFh9jqZTQUA5eenhZJ6BdIC5T+LWPzv/+AcSxbLapbcjr hagdgIqRdb+EN/+g70U59oYLb0ia1OeRlGIpmCvW7YiNiedtyTDrZe8AcA3XbqNgwSMY Y5eBZRJa/6ZYPUJR7UuCGvEDrIb9HtZzKIYi0OQ0c81lrROLNuqc6NFkDt4rp9QShMQ5 VbsMXbcg968hINCzV0AZ1+xxposOeKLZxrxbzZjv7u0slL8bCqT3uUJah76GXsD7nI3f GZNPVGtE3ZnbQSQt00DTp5lIA0D0l6EHODwvnvRWdAZKvCdoahGN/W/0Uw9N0C+SdL1k 4n6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=k2u9bLHeCkW2sI7qPqLe3kI1MAwc5YOPhis0jyjf3HU=; b=i9UjIEGi86epz7SVANE1c7MNi1VKjQFXDVACR2kLRVz69mJ+BQyH5VEp0RLHw18dzG atb3EcHemmFXnrGCe4QAAAKUA8AykRE1IMVbXVuiQWTxVPCqnswI/oaV1o1QXfXp4KpQ u4T4p3MgUAiisJcff7pe50L+WlWFiVDbpkb03a5++9538Q3a8psXLSJZwnutlA9VZaN5 P07Ivt4M+lvDplqBAUbBHYiisEcAdljG3KNU38ZZK3g/1xYEl8by9gIrGZ0ZCozkMkbv YkHdFK92ehSb54bcpbwkEEw4P5PJ/H6Tr3osNBd2g11FbYcl/B4hPKBlpbUX9UtAnxke czJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kTu8ZZ17; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v21sor14113294ljc.15.2019.10.16.07.16.31 for (Google Transport Security); Wed, 16 Oct 2019 07:16:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kTu8ZZ17; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=k2u9bLHeCkW2sI7qPqLe3kI1MAwc5YOPhis0jyjf3HU=; b=kTu8ZZ17AkTFg7mnu9VxS//jUQYFzfzTnOUPIlKmoQVRKPGwNk8nsvhIV/lCYRe+TK mnxL3UZ1WkkCMX25h+o1ifR2W8aj8tCknphOSLlhz3eEBBesRAd2YdFY/1XdCMWN8Wlw RH26V4HbbFrisf7keu8XrLlQtxEWZR9vzUVSnhpMRUNijmi+IUn23PcleZYHlZ7fpkRV Cyeu4htASVOcoMHmp+zGOwEFj/r6tNYXqwLprQo66Gh5y5D5Om6GpI6TY3Ls7OdDFab6 oDv4kxfImiafA+f3UmUETw1u2JSRET3TyPni+98dSPio76f9s3iH5VHQaBZua11aC0ma 0U1Q== 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; bh=k2u9bLHeCkW2sI7qPqLe3kI1MAwc5YOPhis0jyjf3HU=; b=hgtjXdS1jRcqyMjYPMaGoKFGkZMlExfTYZ13bfKrRIabwpbUTt+poMn1HEHmpMzKni 8obKXiFZpWrRwvcKcmnNGfckwF5NIsq+mGTSR8WzISF0hqtaJIt9wDigLDVmcrDSCv3h 40Pd7GgfO7rEKin+Rc3xFMtvDAX1qT/cLjNT1qZXT5AuFY4FT21b1WHasjoPwKqcgvMb FTibHQX1IETXJRH1Xgpx/+iuNHe82T4xkeDa97JLNTvPIRsLpQgZk0SNDxXNirkV/kw+ fPPn7WLWSvTExGrab2KvgBDBGrxX7tddP9DJ0s/KP4YNnBw9dwEwkMiHj3Cbgv0l7KXh rfgg== X-Gm-Message-State: APjAAAXqrPoVf8eSnIqT+eET4wzHyWcxFY3CT0HNXA/6YerUtsONyO2w lbhy7cRf4s9YZRYZ9PKZ0az+rRHD/vorkg== X-Google-Smtp-Source: APXvYqwJeoPN8LR96JI35Bi18ipmT0uImkhDRheIHQ7sN2fQZvKHdZ9gR1Za+v4DMcUW0tr3G3KAfg== X-Received: by 2002:a2e:6a04:: with SMTP id f4mr5222844ljc.186.1571235391447; Wed, 16 Oct 2019 07:16:31 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id d25sm6501463lfj.15.2019.10.16.07.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 07:16:30 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson Subject: [PATCH] PM / core: Cleanup some function definitions in power.h Date: Wed, 16 Oct 2019 16:16:27 +0200 Message-Id: <20191016141627.18642-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 The power.h is a bit messy due to the various existing CONFIG_PM* Kconfig combinations. However the final section for wakeup_source_sysfs*() can be moved inside one of the existing sections rather than adding yet another one, so let's do that to clean up the code a little bit. Signed-off-by: Ulf Hansson --- drivers/base/power/power.h | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) -- 2.17.1 diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index 39a06a0cfdaa..444f5c169a0b 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h @@ -117,6 +117,13 @@ static inline bool device_pm_initialized(struct device *dev) return dev->power.in_dpm_list; } +/* drivers/base/power/wakeup_stats.c */ +extern int wakeup_source_sysfs_add(struct device *parent, + struct wakeup_source *ws); +extern void wakeup_source_sysfs_remove(struct wakeup_source *ws); + +extern int pm_wakeup_source_sysfs_add(struct device *parent); + #else /* !CONFIG_PM_SLEEP */ static inline void device_pm_sleep_init(struct device *dev) {} @@ -141,6 +148,11 @@ static inline bool device_pm_initialized(struct device *dev) return device_is_registered(dev); } +static inline int pm_wakeup_source_sysfs_add(struct device *parent) +{ + return 0; +} + #endif /* !CONFIG_PM_SLEEP */ static inline void device_pm_init(struct device *dev) @@ -149,21 +161,3 @@ static inline void device_pm_init(struct device *dev) device_pm_sleep_init(dev); pm_runtime_init(dev); } - -#ifdef CONFIG_PM_SLEEP - -/* drivers/base/power/wakeup_stats.c */ -extern int wakeup_source_sysfs_add(struct device *parent, - struct wakeup_source *ws); -extern void wakeup_source_sysfs_remove(struct wakeup_source *ws); - -extern int pm_wakeup_source_sysfs_add(struct device *parent); - -#else /* !CONFIG_PM_SLEEP */ - -static inline int pm_wakeup_source_sysfs_add(struct device *parent) -{ - return 0; -} - -#endif /* CONFIG_PM_SLEEP */