diff options
author | Arumuga Durai A <cadurai@codeaurora.org> | 2017-06-14 13:18:26 +0530 |
---|---|---|
committer | Arumuga Durai A <cadurai@codeaurora.org> | 2017-06-30 12:31:01 +0530 |
commit | 0a28ea9cf0d11291c29bffa1d0df4a905f431cd4 (patch) | |
tree | 65efb462b9ea9f559250cff4ff4451af39880fef | |
parent | 560a996da5c0bf398d2fba51e9909cd7323afea8 (diff) |
usb: bam: Remove inactivity_timer sysfs attribute
Sysfs attribute "inactivity_timer" not being used anymore so remove that
entry from sysfs.
CRs-Fixed: 2048725
Change-Id: I30d2d4a3cb9899b7975a6395eab90337fc006488
Signed-off-by: Arumuga Durai A <cadurai@codeaurora.org>
-rw-r--r-- | drivers/platform/msm/usb_bam.c | 81 |
1 files changed, 1 insertions, 80 deletions
diff --git a/drivers/platform/msm/usb_bam.c b/drivers/platform/msm/usb_bam.c index 5cb017fdf2d3..a151d0c7a770 100644 --- a/drivers/platform/msm/usb_bam.c +++ b/drivers/platform/msm/usb_bam.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -3100,79 +3100,6 @@ static int enable_usb_bam(struct platform_device *pdev) return 0; } -static ssize_t -usb_bam_show_inactivity_timer(struct device *dev, struct device_attribute *attr, - char *buf) -{ - char *buff = buf; - int i; - - for (i = 0; i < ARRAY_SIZE(bam_enable_strings); i++) { - buff += snprintf(buff, PAGE_SIZE, "%s: %dms\n", - bam_enable_strings[i], - msm_usb_bam[i].inactivity_timer_ms); - } - - return buff - buf; -} - -static ssize_t usb_bam_store_inactivity_timer(struct device *dev, - struct device_attribute *attr, - const char *buff, size_t count) -{ - char buf[USB_BAM_MAX_STR_LEN]; - char *trimmed_buf, *bam_str, *bam_name, *timer; - int timer_d; - int bam; - - if (strnstr(buff, "help", USB_BAM_MAX_STR_LEN)) { - pr_info("Usage: <bam_name> <ms>,<bam_name> <ms>,...\n"); - pr_info("\tbam_name: [%s, %s, %s]\n", - bam_enable_strings[DWC3_CTRL], - bam_enable_strings[CI_CTRL], - bam_enable_strings[HSIC_CTRL]); - pr_info("\tms: time in ms. Use 0 to disable timer\n"); - return count; - } - - strlcpy(buf, buff, sizeof(buf)); - trimmed_buf = strim(buf); - - while (trimmed_buf) { - bam_str = strsep(&trimmed_buf, ","); - if (bam_str) { - bam_name = strsep(&bam_str, " "); - bam = get_bam_type_from_core_name(bam_name); - if (bam < 0 || bam >= MAX_BAMS) { - log_event_err("%s: Invalid bam, type=%d ,name=%s\n", - __func__, bam, bam_name); - return -EINVAL; - } - - timer = strsep(&bam_str, " "); - - if (!timer) - continue; - - sscanf(timer, "%d", &timer_d); - - /* Apply new timer setting if bam has running pipes */ - if (msm_usb_bam[bam].inactivity_timer_ms != timer_d) { - msm_usb_bam[bam].inactivity_timer_ms = timer_d; - if (msm_usb_bam[bam].pipes_enabled_per_bam > 0 - && !info[bam].in_lpm) - usb_bam_set_inactivity_timer(bam); - } - } - } - - return count; -} - -static DEVICE_ATTR(inactivity_timer, S_IWUSR | S_IRUSR, - usb_bam_show_inactivity_timer, - usb_bam_store_inactivity_timer); - static int usb_bam_panic_notifier(struct notifier_block *this, unsigned long event, void *ptr) { @@ -3221,12 +3148,6 @@ static int usb_bam_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "usb_bam_probe\n"); - ret = device_create_file(&pdev->dev, &dev_attr_inactivity_timer); - if (ret) { - dev_err(&pdev->dev, "failed to create fs node\n"); - return ret; - } - io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!io_res) { dev_err(&pdev->dev, "missing BAM memory resource\n"); |