[U-Boot] [PATCH 1/9] ioport.h: Remove struct resource & co
Paul Burton
paul.burton at imgtec.com
Fri Jan 29 14:54:47 CET 2016
We only use struct resource in a single place (drivers/usb/dwc3/core.h)
for a field (xhci_resources) which is never used. Only ARM currently
defines resource_size_t which means linux/ioport.h only compiles there.
In preparation for making use of the IORESOURCE_ flags, remove struct
resource & the various declarations of functions which we don't
implement.
Signed-off-by: Paul Burton <paul.burton at imgtec.com>
---
drivers/usb/dwc3/core.h | 1 -
include/linux/ioport.h | 104 ------------------------------------------------
2 files changed, 105 deletions(-)
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 72d2fcd..a0fbc8c 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -716,7 +716,6 @@ struct dwc3 {
struct device *dev;
struct platform_device *xhci;
- struct resource xhci_resources[DWC3_XHCI_RESOURCES_NUM];
struct dwc3_event_buffer **ev_buffs;
struct dwc3_ep *eps[DWC3_ENDPOINTS_NUM];
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 7129504..74f562d 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -8,27 +8,6 @@
#ifndef _LINUX_IOPORT_H
#define _LINUX_IOPORT_H
-#ifndef __ASSEMBLY__
-#include <linux/compiler.h>
-#include <linux/types.h>
-/*
- * Resources are tree-like, allowing
- * nesting etc..
- */
-struct resource {
- resource_size_t start;
- resource_size_t end;
- const char *name;
- unsigned long flags;
- struct resource *parent, *sibling, *child;
-};
-
-struct resource_list {
- struct resource_list *next;
- struct resource *res;
- struct pci_dev *dev;
-};
-
/*
* IO resources have these defined flags.
*/
@@ -106,87 +85,4 @@ struct resource_list {
/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
-/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
-extern struct resource ioport_resource;
-extern struct resource iomem_resource;
-
-extern int request_resource(struct resource *root, struct resource *new);
-extern int release_resource(struct resource *new);
-extern void reserve_region_with_split(struct resource *root,
- resource_size_t start, resource_size_t end,
- const char *name);
-extern int insert_resource(struct resource *parent, struct resource *new);
-extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
-extern int allocate_resource(struct resource *root, struct resource *new,
- resource_size_t size, resource_size_t min,
- resource_size_t max, resource_size_t align,
- void (*alignf)(void *, struct resource *,
- resource_size_t, resource_size_t),
- void *alignf_data);
-int adjust_resource(struct resource *res, resource_size_t start,
- resource_size_t size);
-resource_size_t resource_alignment(struct resource *res);
-static inline resource_size_t resource_size(const struct resource *res)
-{
- return res->end - res->start + 1;
-}
-static inline unsigned long resource_type(const struct resource *res)
-{
- return res->flags & IORESOURCE_TYPE_BITS;
-}
-
-/* Convenience shorthand with allocation */
-#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0)
-#define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl)
-#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0)
-#define request_mem_region_exclusive(start,n,name) \
- __request_region(&iomem_resource, (start), (n), (name), IORESOURCE_EXCLUSIVE)
-#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
-
-extern struct resource * __request_region(struct resource *,
- resource_size_t start,
- resource_size_t n,
- const char *name, int flags);
-
-/* Compatibility cruft */
-#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
-#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
-#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
-
-extern int __check_region(struct resource *, resource_size_t, resource_size_t);
-extern void __release_region(struct resource *, resource_size_t,
- resource_size_t);
-
-static inline int __deprecated check_region(resource_size_t s,
- resource_size_t n)
-{
- return __check_region(&ioport_resource, s, n);
-}
-
-/* Wrappers for managed devices */
-struct device;
-#define devm_request_region(dev,start,n,name) \
- __devm_request_region(dev, &ioport_resource, (start), (n), (name))
-#define devm_request_mem_region(dev,start,n,name) \
- __devm_request_region(dev, &iomem_resource, (start), (n), (name))
-
-extern struct resource * __devm_request_region(struct device *dev,
- struct resource *parent, resource_size_t start,
- resource_size_t n, const char *name);
-
-#define devm_release_region(dev, start, n) \
- __devm_release_region(dev, &ioport_resource, (start), (n))
-#define devm_release_mem_region(dev, start, n) \
- __devm_release_region(dev, &iomem_resource, (start), (n))
-
-extern void __devm_release_region(struct device *dev, struct resource *parent,
- resource_size_t start, resource_size_t n);
-extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
-extern int iomem_is_exclusive(u64 addr);
-
-extern int
-walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
- void *arg, int (*func)(unsigned long, unsigned long, void *));
-
-#endif /* __ASSEMBLY__ */
#endif /* _LINUX_IOPORT_H */
--
2.7.0
More information about the U-Boot
mailing list