summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-05-20 16:08:58 -0700
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-23 17:36:19 -0700
commitf498300733f10f5cddfef5da7fc8fc28c9c9a490 (patch)
tree8fb4f13b751123b4cdf313b11fab4d1cdde9565f
parentb41597031bc4e9084cc1a89a7cce044082d747a5 (diff)
ARM: tegra: power: Fix warnings when CONFIG_PM is disabled
Change-Id: I9d4b8c218cdfe6a91424b808f70c1ec056015783 Reviewed-on: http://git-master/r/32463 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/suspend.c86
-rw-r--r--drivers/usb/host/ehci-tegra.c2
2 files changed, 45 insertions, 43 deletions
diff --git a/arch/arm/mach-tegra/suspend.c b/arch/arm/mach-tegra/suspend.c
index bf0b65b11549..8a1810b9a0db 100644
--- a/arch/arm/mach-tegra/suspend.c
+++ b/arch/arm/mach-tegra/suspend.c
@@ -223,49 +223,6 @@ static unsigned long tegra_cluster_switch_times[tegra_cluster_switch_time_id_max
#define cpu_number() 0
#endif
-static ssize_t suspend_mode_show(struct kobject *kobj,
- struct kobj_attribute *attr, char *buf)
-{
- char *start = buf;
- char *end = buf + PAGE_SIZE;
-
- start += scnprintf(start, end - start, "%s ", \
- tegra_suspend_name[current_suspend_mode]);
- start += scnprintf(start, end - start, "\n");
-
- return start - buf;
-}
-
-static ssize_t suspend_mode_store(struct kobject *kobj,
- struct kobj_attribute *attr,
- const char *buf, size_t n)
-{
- int len;
- const char *name_ptr;
- enum tegra_suspend_mode new_mode;
-
- name_ptr = buf;
- while (*name_ptr && !isspace(*name_ptr))
- name_ptr++;
- len = name_ptr - buf;
- if (!len)
- goto bad_name;
-
- for (new_mode = TEGRA_SUSPEND_NONE; \
- new_mode < TEGRA_MAX_SUSPEND_MODE; ++new_mode) {
- if (!strncmp(buf, tegra_suspend_name[new_mode], len)) {
- current_suspend_mode = new_mode;
- break;
- }
- }
-
-bad_name:
- return n;
-}
-
-static struct kobj_attribute suspend_mode_attribute =
- __ATTR(mode, 0666, suspend_mode_show, suspend_mode_store);
-
static inline unsigned int time_to_bin(unsigned int time)
{
return fls(time);
@@ -981,6 +938,49 @@ static struct platform_suspend_ops tegra_suspend_ops = {
.wake = tegra_suspend_wake,
.enter = tegra_suspend_enter,
};
+
+static ssize_t suspend_mode_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ char *start = buf;
+ char *end = buf + PAGE_SIZE;
+
+ start += scnprintf(start, end - start, "%s ", \
+ tegra_suspend_name[current_suspend_mode]);
+ start += scnprintf(start, end - start, "\n");
+
+ return start - buf;
+}
+
+static ssize_t suspend_mode_store(struct kobject *kobj,
+ struct kobj_attribute *attr,
+ const char *buf, size_t n)
+{
+ int len;
+ const char *name_ptr;
+ enum tegra_suspend_mode new_mode;
+
+ name_ptr = buf;
+ while (*name_ptr && !isspace(*name_ptr))
+ name_ptr++;
+ len = name_ptr - buf;
+ if (!len)
+ goto bad_name;
+
+ for (new_mode = TEGRA_SUSPEND_NONE; \
+ new_mode < TEGRA_MAX_SUSPEND_MODE; ++new_mode) {
+ if (!strncmp(buf, tegra_suspend_name[new_mode], len)) {
+ current_suspend_mode = new_mode;
+ break;
+ }
+ }
+
+bad_name:
+ return n;
+}
+
+static struct kobj_attribute suspend_mode_attribute =
+ __ATTR(mode, 0666, suspend_mode_show, suspend_mode_store);
#endif
void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat)
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index e895a078f406..6a7045408e6d 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -299,6 +299,7 @@ done:
return retval;
}
+#ifdef CONFIG_PM
static void tegra_ehci_restart(struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
@@ -465,6 +466,7 @@ restart:
return 0;
}
+#endif
static void tegra_ehci_shutdown(struct usb_hcd *hcd)
{