Lines Matching +full:ctrl +full:- +full:len
1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (c) 2001,2003 Greg Kroah-Hartman (greg@kroah.com)
29 size_t len = 0; in show_ctrl() local
33 bus = pdev->subordinate; in show_ctrl()
35 len += sysfs_emit_at(buf, len, "Free resources: memory\n"); in show_ctrl()
37 if (res && (res->flags & IORESOURCE_MEM) && in show_ctrl()
38 !(res->flags & IORESOURCE_PREFETCH)) { in show_ctrl()
39 len += sysfs_emit_at(buf, len, in show_ctrl()
41 (unsigned long long)res->start, in show_ctrl()
45 len += sysfs_emit_at(buf, len, "Free resources: prefetchable memory\n"); in show_ctrl()
47 if (res && (res->flags & IORESOURCE_MEM) && in show_ctrl()
48 (res->flags & IORESOURCE_PREFETCH)) { in show_ctrl()
49 len += sysfs_emit_at(buf, len, in show_ctrl()
51 (unsigned long long)res->start, in show_ctrl()
55 len += sysfs_emit_at(buf, len, "Free resources: IO\n"); in show_ctrl()
57 if (res && (res->flags & IORESOURCE_IO)) { in show_ctrl()
58 len += sysfs_emit_at(buf, len, in show_ctrl()
60 (unsigned long long)res->start, in show_ctrl()
64 len += sysfs_emit_at(buf, len, "Free resources: bus numbers\n"); in show_ctrl()
65 for (busnr = bus->busn_res.start; busnr <= bus->busn_res.end; busnr++) { in show_ctrl()
69 if (busnr < bus->busn_res.end) in show_ctrl()
70 len += sysfs_emit_at(buf, len, in show_ctrl()
72 busnr, (int)(bus->busn_res.end - busnr)); in show_ctrl()
74 return len; in show_ctrl()
76 static DEVICE_ATTR(ctrl, S_IRUGO, show_ctrl, NULL);
78 int shpchp_create_ctrl_files(struct controller *ctrl) in shpchp_create_ctrl_files() argument
80 return device_create_file(&ctrl->pci_dev->dev, &dev_attr_ctrl); in shpchp_create_ctrl_files()
83 void shpchp_remove_ctrl_files(struct controller *ctrl) in shpchp_remove_ctrl_files() argument
85 device_remove_file(&ctrl->pci_dev->dev, &dev_attr_ctrl); in shpchp_remove_ctrl_files()