Skip to content

Commit 6220358

Browse files
committed
Merge branch 'constify-sfp-phy-nodes'
Russell King says: ==================== Constify a few sfp/phy fwnodes This series constifies a bunch of fwnode_handle pointers that are only used to refer to but not modify the contents of the fwnode structures. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e3cbdcb + 4a0faa0 commit 6220358

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

drivers/net/phy/phy_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3057,7 +3057,7 @@ EXPORT_SYMBOL_GPL(device_phy_find_device);
30573057
* and "phy-device" are not supported in ACPI. DT supports all the three
30583058
* named references to the phy node.
30593059
*/
3060-
struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode)
3060+
struct fwnode_handle *fwnode_get_phy_node(const struct fwnode_handle *fwnode)
30613061
{
30623062
struct fwnode_handle *phy_node;
30633063

drivers/net/phy/sfp-bus.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct sfp_bus {
1717
/* private: */
1818
struct kref kref;
1919
struct list_head node;
20-
struct fwnode_handle *fwnode;
20+
const struct fwnode_handle *fwnode;
2121

2222
const struct sfp_socket_ops *socket_ops;
2323
struct device *sfp_dev;
@@ -390,7 +390,7 @@ static const struct sfp_upstream_ops *sfp_get_upstream_ops(struct sfp_bus *bus)
390390
return bus->registered ? bus->upstream_ops : NULL;
391391
}
392392

393-
static struct sfp_bus *sfp_bus_get(struct fwnode_handle *fwnode)
393+
static struct sfp_bus *sfp_bus_get(const struct fwnode_handle *fwnode)
394394
{
395395
struct sfp_bus *sfp, *new, *found = NULL;
396396

@@ -593,7 +593,7 @@ static void sfp_upstream_clear(struct sfp_bus *bus)
593593
* - %-ENOMEM if we failed to allocate the bus.
594594
* - an error from the upstream's connect_phy() method.
595595
*/
596-
struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
596+
struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
597597
{
598598
struct fwnode_reference_args ref;
599599
struct sfp_bus *bus;

include/linux/phy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id);
15471547
struct mdio_device *fwnode_mdio_find_device(struct fwnode_handle *fwnode);
15481548
struct phy_device *fwnode_phy_find_device(struct fwnode_handle *phy_fwnode);
15491549
struct phy_device *device_phy_find_device(struct device *dev);
1550-
struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode);
1550+
struct fwnode_handle *fwnode_get_phy_node(const struct fwnode_handle *fwnode);
15511551
struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
15521552
int phy_device_register(struct phy_device *phy);
15531553
void phy_device_free(struct phy_device *phydev);

include/linux/sfp.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ int sfp_get_module_eeprom_by_page(struct sfp_bus *bus,
557557
void sfp_upstream_start(struct sfp_bus *bus);
558558
void sfp_upstream_stop(struct sfp_bus *bus);
559559
void sfp_bus_put(struct sfp_bus *bus);
560-
struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode);
560+
struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode);
561561
int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
562562
const struct sfp_upstream_ops *ops);
563563
void sfp_bus_del_upstream(struct sfp_bus *bus);
@@ -619,7 +619,8 @@ static inline void sfp_bus_put(struct sfp_bus *bus)
619619
{
620620
}
621621

622-
static inline struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
622+
static inline struct sfp_bus *
623+
sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
623624
{
624625
return NULL;
625626
}

0 commit comments

Comments
 (0)