Skip to content

Commit 6ba5595

Browse files
committed
logic_pio: Constify fwnode_handle
The fwnode_handle passed into find_io_range_by_fwnode() and logic_pio_trans_hwaddr() are not modified, so make them const. Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 1d31c6f commit 6ba5595

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/linux/logic_pio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum {
1717

1818
struct logic_pio_hwaddr {
1919
struct list_head list;
20-
struct fwnode_handle *fwnode;
20+
const struct fwnode_handle *fwnode;
2121
resource_size_t hw_start;
2222
resource_size_t io_start;
2323
resource_size_t size; /* range size populated */
@@ -110,8 +110,8 @@ void logic_outsl(unsigned long addr, const void *buffer, unsigned int count);
110110
#endif /* CONFIG_INDIRECT_PIO */
111111
#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
112112

113-
struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode);
114-
unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
113+
struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwnode);
114+
unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
115115
resource_size_t hw_addr, resource_size_t size);
116116
int logic_pio_register_range(struct logic_pio_hwaddr *newrange);
117117
void logic_pio_unregister_range(struct logic_pio_hwaddr *range);

lib/logic_pio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void logic_pio_unregister_range(struct logic_pio_hwaddr *range)
122122
*
123123
* Traverse the io_range_list to find the registered node for @fwnode.
124124
*/
125-
struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode)
125+
struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwnode)
126126
{
127127
struct logic_pio_hwaddr *range, *found_range = NULL;
128128

@@ -186,7 +186,7 @@ resource_size_t logic_pio_to_hwaddr(unsigned long pio)
186186
*
187187
* Returns Logical PIO value if successful, ~0UL otherwise
188188
*/
189-
unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
189+
unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
190190
resource_size_t addr, resource_size_t size)
191191
{
192192
struct logic_pio_hwaddr *range;

0 commit comments

Comments
 (0)