Skip to content

Commit d28b030

Browse files
raagjadavgregkh
authored andcommitted
err.h: move IOMEM_ERR_PTR() to err.h
commit 18311a7 upstream. Since IOMEM_ERR_PTR() macro deals with an error pointer, a better place for it is err.h. This helps avoid dependency on io.h for the users that don't need it. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Raag Jadav <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 96537d8 commit d28b030

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/linux/err.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ static inline void * __must_check ERR_PTR(long error)
4444
/* Return the pointer in the percpu address space. */
4545
#define ERR_PTR_PCPU(error) ((void __percpu *)(unsigned long)ERR_PTR(error))
4646

47+
/* Cast an error pointer to __iomem. */
48+
#define IOMEM_ERR_PTR(error) (__force void __iomem *)ERR_PTR(error)
49+
4750
/**
4851
* PTR_ERR - Extract the error code from an error pointer.
4952
* @ptr: An error pointer.

include/linux/io.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)
6565
}
6666
#endif
6767

68-
#define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err)
69-
7068
void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
7169
resource_size_t size);
7270
void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,

0 commit comments

Comments
 (0)